Part Number Hot Search : 
FP10130A TZ20B 2SB1245 6GBU06 RGP10J V120ZS4 1N474 IRG4BC
Product Description
Full Text Search
 

To Download MC68HC711PA8 Datasheet File

  If you can't view the Datasheet, Please click here to try to view without PDF Reader .  
 
 


  Datasheet File OCR Text:
  hc11 mc68hc11pa8/d mc68hc11pa8 MC68HC711PA8 mc68hc11pb8 mc68hc711pb8 technical data mc68hc11pa8 technical data

1 2 3 4 5 6 7 8 9 10 11 a b c introduction pin descriptions cpu core and instruction set operating modes and on-chip memory resets and interrupts parallel input/output serial communications interface i 2 c bus serial peripheral interface timing system analog-to-digital converter electrical specifications mechanical data and ordering information development support tpg 1
1 2 3 4 5 6 7 8 9 10 11 a b c introduction pin descriptions cpu core and instruction set operating modes and on-chip memory resets and interrupts parallel input/output serial communications interface i 2 c bus serial peripheral interface timing system analog-to-digital converter electrical specifications mechanical data and ordering information development support tpg 2
all products are sold on motorola? terms & conditions of supply. in ordering a product covered by this document the customer agrees to be bound by those terms & conditions and nothing contained in this document constitutes or forms part of a contract (with the exception of the contents of this notice). a copy of motorola? terms & conditions of supply is availab le on request. motorola reserves the right to make changes without further notice to any products herein. motorola makes no warranty, representation or guarantee regarding the suitability of its products for any particular purpose, nor does motorola assume any liability arising out of the application or use of any product or circuit, and specifically disclaims any and all liability, in cluding without limitation consequential or incidental damages. ?ypical?parameters can and do vary in different applications. all operating parameters, including ?ypicals? must be validated for each customer application by customer? technical experts. motorola does not convey any license under its patent rights nor the rights of others. motorola products are not designed, intended, or authorized for use as components in systems intended for surgical implant into the body, or other applications intended to support or sustain life, or for any other application in which the failure of the motorola product could create a situation where personal injury or death may occur. should buyer purchase or use motorola products for any such unintended or unauthorized application, buyer shall indemnify and hold motorola and its officers, employees, subsidiaries, affiliates, and distributors harmless against all claims, costs, damages, and expenses, and reasonable attorney fees arising out of, directly or indirectly, any claim of personal injury or death associated with such unintended or unauthorized use, even if such claim alleges that motorola was negligent regarding the design or manufacture of the part. motorola and ! are registered trademarks of motorola, inc. motorola, inc. is an equal opportunity/affirmative action employer. the customer should ensure that it has the most up to date version of the document by contacting its local motorola office. this document supersedes any earlier documentation relating to the products referred to herein. the information contained in this document is current at the date of publication. it may subsequently be updated, revised or withdrawn. motorola ltd., 1997 all trade marks recognized. this document contains information on new products. speci?ations and information herein are subject to change without notice. mc68hc11pa8/ mc68hc11pb8 MC68HC711PA8/ mc68hc711pb8 high-density complementary metal oxide semiconductor (hcmos) microcontroller unit tpg 3
tpg 4 conventions where abbreviations are used in the text, an explanation can be found in the glossary, at the back of this manual. register and bit mnemonics are de?ed in the paragraphs describing them. an overbar is used to designate an active-low signal, eg: reset . because the bits in any one register are not necessarily linked by a common function, the description of a register may appear in several sections referring to different aspects of device operation. a full description of a bit is given only in a section in which it has relevance. elsewhere, it appears shaded in the register diagram and is only brie? described. when the state of a bit on reset is described as ?? this means that its state depends on factors such as the operating mode selected. a ? indicates that the bits state on reset is unde?ed.
customer feedback questionnaire (mc68hc11pa8/d) motorola wishes to continue to improve the quality of its documentation. we would welcome your feedback on the publication you have just received. having used the document, please complete this card (or a photocopy of it, if you prefer). 1. how would you rate the quality of the document? check one box in each category. excellent poor excellent poor organization oooo tables oooo readability oooo table of contents oooo understandability oooo index oooo accuracy oooo page size/binding oooo illustrations oooo overall impression oooo comments: 2. what is your intended use for this document? if more than one option applies, please rank them (1, 2, 3). selection of device for new application o other o please specify: system design o training purposes o 3. how well does this manual enable you to perform the task(s) outlined in question 2? completely not at all comments: oooo 4. how easy is it to ?d the information you are looking for? easy dif?ult comments: oooo 5. is the level of technical detail in the following sections suf?ient to allow you to understand how the device functions? too little detail too much detail ooooo ooooo ooooo ooooo ooooo ooooo ooooo ooooo ooooo ooooo ooooo ooooo ooooo ooooo comments: 6. have you found any errors? if so, please comment: 7. from your point of view, is anything missing from the document? if so, please say what: ?cut along this line to remove " section 1 introduction section 2 pin descriptions section 3 cpu core and instruction set section 4 operating modes and on-chip memory section 5 resets and interrupts section 6 parallel input/output section 7 serial communications interface section 8 i 2 c bus section 9 serial peripheral interface section 10 timing system section 11 analog-to-digital converter section a electrical specifications section b mechanical data and ordering information section c development support tpg 5
13. currently there is some discussion in the semiconductor industry regarding a move towards providing data sheets in electron ic form. if you have any opinion on this subject, please comment. 14. we would be grateful if you would supply the following information (at your discretion), or attach your card. name: phone no: position: fax no: department: company: address: thank you for helping us improve our documentation, technical publications manager, motorola ltd., scotland . ?cut along this line to remove ?third fold back along this line 8. how could we improve this document? 9. how would you rate motorolas documentation? excellent poor ?in general oo oo ?against other semiconductor suppliers oo oo 10. which semiconductor manufacturer provides the best technical documentation? 11. which company (in any ?ld) provides the best technical documentation? 12. how many years have you worked with microprocessors? less than 1 year o 1? years o 3? years o more than 5 years o by air mail par avion ne pas affranchir ibrs number phq-b/207/g ccri numero phq-b/207/g reponse payee grande-bretagne motorola ltd., colvilles road, kelvin industrial estate, east kilbride, g75 8br. great britain. f.a.o. technical publications group (re: mc68hc11pa8/d) no stamp required ?first fold back along this line !motorola semiconductor products sector ?second fold back along this line ? finally, tuck this edge into opposite ?p " tpg 6
mc68hc11pa8 motorola i table of contents paragraph number page number title table of contents 1 introduction 1.1 features ................................................................................................................ 1-1 1.2 mask options ......................................................................................................... 1-2 2 pin descriptions 2.1 vdd and vss ........................................................................................................ 2-2 2.2 reset ................................................................................................................... 2-3 2.3 crystal driver and external clock input (xtal, extal).......................................... 2-3 2.4 e clock output (e) .................................................................................................. 2-5 2.5 phase-locked loop (xfc, vddsyn)...................................................................... 2-6 2.5.1 pll operation .................................................................................................. 2-7 2.5.2 synchronization of pll with subsystems ........................................................ 2-8 2.5.3 changing the pll frequency ........................................................................... 2-8 2.5.4 pll registers.................................................................................................... 2-8 2.5.4.1 pllcr ?pll control register................................................................... 2-9 2.5.4.2 synr ?synthesizer program register ..................................................... 2-11 2.6 interrupt request (irq ) .......................................................................................... 2-12 2.7 nonmaskable interrupt (xirq/vppe).................................................................... 2-12 2.8 moda and modb (moda/lir and modb/vstby)............................................. 2-13 2.9 vrh and vrl ........................................................................................................ 2-13 2.10 pg7/r/w ............................................................................................................... 2-13 2.11 port signals............................................................................................................ 2-1 4 2.11.1 port a ............................................................................................................... 2-14 2.11.2 port b ............................................................................................................... 2-14 2.11.3 port c............................................................................................................... 2-15 2.11.4 port d............................................................................................................... 2-16 2.11.5 port e ............................................................................................................... 2-16 2.11.6 port f ............................................................................................................... 2-17 2.11.7 port g .............................................................................................................. 2-17 tpg 7
motorola ii mc68hc11pa8 table of contents paragraph number page number title 3 cpu core and instruction set 3.1 registers ............................................................................................................... 3-1 3.1.1 accumulators a, b and d................................................................................. 3-2 3.1.2 index register x (ix)......................................................................................... 3-2 3.1.3 index register y (iy) ......................................................................................... 3-2 3.1.4 stack pointer (sp)............................................................................................ 3-2 3.1.5 program counter (pc)...................................................................................... 3-4 3.1.6 condition code register (ccr) ........................................................................ 3-4 3.1.6.1 carry/borrow (c) ........................................................................................ 3-5 3.1.6.2 over?w (v) ............................................................................................... 3-5 3.1.6.3 zero (z) ...................................................................................................... 3-5 3.1.6.4 negative (n) ............................................................................................... 3-5 3.1.6.5 interrupt mask (i)........................................................................................ 3-5 3.1.6.6 half carry (h) ............................................................................................. 3-6 3.1.6.7 x interrupt mask (x) ................................................................................... 3-6 3.1.6.8 stop disable (s) ......................................................................................... 3-6 3.2 data types ............................................................................................................. 3-6 3.3 opcodes and operands ......................................................................................... 3-7 3.4 addressing modes................................................................................................. 3-7 3.5 immediate (imm) ................................................................................................... 3-7 3.5.1 direct (dir)...................................................................................................... 3-7 3.5.2 extended (ext) ............................................................................................... 3-8 3.5.3 indexed (ind, x; ind, y)................................................................................... 3-8 3.5.4 inherent (inh) .................................................................................................. 3-8 3.5.5 relative (rel) ................................................................................................. 3-8 3.6 instruction set ........................................................................................................ 3-8 4 operating modes and on-chip memory 4.1 operating modes................................................................................................... 4-1 4.1.1 single chip operating mode ............................................................................. 4-1 4.1.2 expanded operating mode .............................................................................. 4-1 4.1.3 special test mode ............................................................................................ 4-2 4.1.4 special bootstrap mode ................................................................................... 4-2 4.2 on-chip memory.................................................................................................... 4-4 4.2.1 mapping allocations ......................................................................................... 4-4 4.2.1.1 ram ........................................................................................................... 4-5 4.2.1.2 rom and eprom...................................................................................... 4-6 4.2.1.3 bootloader rom ........................................................................................ 4-6 4.2.2 registers ......................................................................................................... 4-6 4.3 system initialization............................................................................................... 4-10 4.3.1 mode selection ................................................................................................ 4-10 tpg 8
mc68hc11pa8 motorola iii table of contents paragraph number page number title 4.3.1.1 hprio ?highest priority i-bit interrupt & misc. register ........................... 4-11 4.3.2 initialization ...................................................................................................... 4-12 4.3.2.1 config ?system con?uration register ................................................. 4-12 4.3.2.2 init ?ram and i/o mapping register ...................................................... 4-14 4.3.2.3 init2 ?eeprom mapping register ......................................................... 4-15 4.3.2.4 option ?system con?uration options register 1.................................. 4-16 4.3.2.5 opt2 ?system con?uration options register 2 ...................................... 4-18 4.3.2.6 bprot ?block protect register................................................................ 4-20 4.3.2.7 tmsk2 ?timer interrupt mask register 2................................................. 4-21 4.4 eprom , eeprom and config register ............................................................. 4-22 4.4.1 eprom............................................................................................................ 4-22 4.4.1.1 eprog ?eprom programming control register..................................... 4-22 4.4.1.2 eprom programming ................................................................................ 4-23 4.4.2 eeprom ......................................................................................................... 4-24 4.4.2.1 pprog ?eeprom programming control register .................................. 4-24 4.4.2.2 eeprom bulk erase .................................................................................. 4-26 4.4.2.3 eeprom row erase ................................................................................... 4-27 4.4.2.4 eeprom byte erase .................................................................................. 4-27 4.4.3 config register programming........................................................................ 4-27 4.4.4 ram and eeprom security ............................................................................ 4-28 5 resets and interrupts 5.1 resets ................................................................................................................... 5-1 5.1.1 power-on reset................................................................................................. 5-1 5.1.2 external reset (reset ) ................................................................................... 5-2 5.1.3 cop reset ........................................................................................................ 5-2 5.1.3.1 coprst ?arm/reset cop timer circuitry register................................... 5-3 5.1.4 clock monitor reset .......................................................................................... 5-3 5.1.5 option ?system con?uration options register 1 ....................................... 5-4 5.1.6 config ?con?uration control register ....................................................... 5-5 5.2 effects of reset....................................................................................................... 5-7 5.2.1 central processing unit .................................................................................... 5-7 5.2.2 memory map.................................................................................................... 5-7 5.2.3 parallel i/o ....................................................................................................... 5-8 5.2.4 timer................................................................................................................ 5-8 5.2.5 real-time interrupt (rti) .................................................................................. 5-8 5.2.6 pulse accumulator ........................................................................................... 5-8 5.2.7 computer operating properly (cop)................................................................ 5-9 5.2.8 serial communications interface (sci)............................................................. 5-9 5.2.9 serial peripheral interface (spi)....................................................................... 5-9 5.2.10 i 2 c bus ............................................................................................................. 5-9 5.2.11 analog-to-digital converter ............................................................................... 5-9 5.2.12 system............................................................................................................. 5-9 tpg 9
motorola iv mc68hc11pa8 table of contents paragraph number page number title 5.3 reset and interrupt priority.................................................................................... 5-10 5.3.1 hprio ?highest priority i-bit interrupt and misc. register ............................. 5-11 5.4 interrupts ............................................................................................................... 5-1 4 5.4.1 interrupt recognition and register stacking ...................................................... 5-14 5.4.2 nonmaskable interrupt request (xirq ) ........................................................... 5-15 5.4.3 illegal opcode trap ........................................................................................... 5-15 5.4.4 software interrupt ............................................................................................ 5-15 5.4.5 maskable interrupts ......................................................................................... 5-16 5.4.6 reset and interrupt processing........................................................................ 5-16 5.5 low power operation ............................................................................................. 5-16 5.5.1 wait................................................................................................................ 5-16 5.5.2 stop ............................................................................................................... 5-17 6 parallel input/output 6.1 port a .................................................................................................................... 6- 2 6.1.1 porta ?port a data register ........................................................................ 6-2 6.1.2 ddra ?data direction register for port a...................................................... 6-2 6.2 port b .................................................................................................................... 6- 3 6.2.1 portb ?port b data register........................................................................ 6-3 6.2.2 ddrb ?data direction register for port b...................................................... 6-3 6.3 port c .................................................................................................................... 6- 4 6.3.1 portc ?port c data register ....................................................................... 6-4 6.3.2 ddrc ?data direction register for port c ..................................................... 6-4 6.4 port d .................................................................................................................... 6- 5 6.4.1 portd ?port d data register ....................................................................... 6-5 6.4.2 ddrd ?data direction register for port d ..................................................... 6-5 6.5 port e .................................................................................................................... 6- 6 6.5.1 porte ?port e data register........................................................................ 6-6 6.6 port f..................................................................................................................... 6 -7 6.6.1 portf ?port f data register ........................................................................ 6-7 6.6.2 ddrf ?data direction register for port f ...................................................... 6-7 6.7 port g .................................................................................................................... 6- 8 6.7.1 portg ?port g data register ....................................................................... 6-8 6.7.2 ddrg ?data direction register for port g ..................................................... 6-8 6.8 xirq and irq pins................................................................................................ 6-9 6.8.1 spsr ?spi status register ............................................................................ 6-9 6.9 internal pull-up resistors ........................................................................................ 6-10 6.9.1 ppar ?port pull-up assignment register ....................................................... 6-10 6.10 system con?uration............................................................................................. 6-10 6.10.1 opt2 ?system con?uration options register 2............................................ 6-11 6.10.2 config ?system con?uration register....................................................... 6-12 tpg 10
mc68hc11pa8 motorola v table of contents paragraph number page number title 7 serial communications interface 7.1 data format............................................................................................................ 7-2 7.2 transmit operation ................................................................................................. 7-2 7.3 receive operation.................................................................................................. 7-2 7.4 wake-up feature .................................................................................................... 7-4 7.4.1 idle-line wake-up.............................................................................................. 7-4 7.4.2 address-mark wake-up .................................................................................... 7-4 7.5 sci error detection ................................................................................................ 7-5 7.6 sci registers.......................................................................................................... 7-5 7.6.1 scbdh, scbdl ?sci baud rate control registers ........................................ 7-6 7.6.2 sccr1 ?sci control register 1 ..................................................................... 7-7 7.6.3 sccr2 ?sci control register 2 ..................................................................... 7-9 7.6.4 scsr1 ?sci status register 1....................................................................... 7-10 7.6.5 scsr2 ?sci status register 2....................................................................... 7-12 7.6.6 scdrh, scdrl ?sci data high/low registers ............................................. 7-12 7.7 status ?gs and interrupts..................................................................................... 7-13 7.7.1 receiver ?gs .................................................................................................. 7-13 8 i 2 c bus 8.1 i 2 c bus features..................................................................................................... 8-2 8.2 i 2 c bus system con?uration................................................................................. 8-2 8.3 i 2 c bus protocol..................................................................................................... 8-2 8.3.1 start signal ................................................................................................... 8-4 8.3.2 transmission of the slave address ................................................................... 8-4 8.3.3 data transfer .................................................................................................... 8-4 8.3.4 stop signal..................................................................................................... 8-4 8.3.5 repeated start signal................................................................................... 8-5 8.3.6 arbitration procedure ....................................................................................... 8-5 8.3.7 clock synchronization ...................................................................................... 8-5 8.3.8 handshaking.................................................................................................... 8-6 8.4 registers ............................................................................................................... 8-6 8.4.1 config ?system con?uration register....................................................... 8-6 8.4.2 madr ?i 2 c bus address register .................................................................. 8-7 8.4.3 mfdr ?i 2 c bus frequency divider register.................................................... 8-7 8.4.4 mcr ?i 2 c bus control register ...................................................................... 8-8 8.4.5 msr ?i 2 c bus status register........................................................................ 8-9 8.4.6 mdr ?i 2 c bus data register .......................................................................... 8-10 8.5 programming considerations................................................................................. 8-11 8.5.1 initialization ...................................................................................................... 8-11 8.5.2 start signal and the ?st byte of data............................................................ 8-11 8.5.3 software response ........................................................................................... 8-12 tpg 11
motorola vi mc68hc11pa8 table of contents paragraph number page number title 8.5.4 generation of a stop signal........................................................................... 8-12 8.5.5 generation of a repeated start signal .......................................................... 8-13 8.5.6 slave mode...................................................................................................... 8-13 8.5.7 arbitration lost.................................................................................................. 8-14 8.5.8 operation during stop and wait modes....................................................... 8-14 9 serial peripheral interface 9.1 functional description ........................................................................................... 9-1 9.2 spi transfer formats............................................................................................... 9-2 9.2.1 clock phase and polarity controls.................................................................... 9-3 9.3 spi signals ............................................................................................................ 9-3 9.3.1 master in slave out........................................................................................... 9-4 9.3.2 master out slave in........................................................................................... 9-4 9.3.3 serial clock ...................................................................................................... 9-4 9.3.4 slave select ..................................................................................................... 9-4 9.4 spi system errors.................................................................................................. 9-5 9.5 spi registers.......................................................................................................... 9-5 9.5.1 spcr ?spi control register .......................................................................... 9-6 9.5.2 spsr ?spi status register ............................................................................ 9-8 9.5.3 spdr ?spi data register .............................................................................. 9-9 9.5.4 opt2 ?system con?uration options register 2............................................ 9-9 10 timing system 10.1 timer operation ................................................................................................... 10-1 10.1.1 timer structure .............................................................................................. 10-4 10.1.2 input capture.................................................................................................. 10-6 10.1.2.1 tctl2 ?timer control register 2............................................................ 10-7 10.1.2.2 tic1?ic3 ?timer input capture registers ............................................ 10-8 10.1.2.3 ti4/o5 ?timer input capture 4/output compare 5 register..................... 10-8 10.1.3 output compare ............................................................................................. 10-9 10.1.3.1 toc1?oc4 ?timer output compare registers..................................... 10-10 10.1.3.2 cforc ?timer compare force register................................................. 10-10 10.1.3.3 oc1m ?output compare 1 mask register.............................................. 10-11 10.1.3.4 oc1d ?output compare 1 data register................................................ 10-11 10.1.3.5 tcnt ?timer counter register............................................................... 10-12 10.1.3.6 tctl1 ?timer control register 1............................................................ 10-12 10.1.3.7 tmsk1 ?timer interrupt mask register 1............................................... 10-13 10.1.3.8 tflg1 ?timer interrupt ?g register 1 .................................................. 10-14 10.1.3.9 tmsk2 ?timer interrupt mask register 2............................................... 10-15 10.1.3.10 tflg2 ?timer interrupt ?g register 2 .................................................. 10-16 tpg 12
mc68hc11pa8 motorola vii table of contents paragraph number page number title 10.1.4 real-time interrupt ......................................................................................... 10-17 10.1.4.1 tmsk2 ?timer interrupt mask register 2............................................... 10-17 10.1.4.2 tflg2 ?timer interrupt ?g register 2 .................................................. 10-18 10.1.4.3 pactl ?pulse accumulator control register .......................................... 10-19 10.1.5 computer operating properly watchdog function ........................................... 10-20 10.1.6 pulse accumulator ......................................................................................... 10-20 10.1.6.1 pactl ?pulse accumulator control register .......................................... 10-22 10.1.6.2 pacnt ?pulse accumulator count register............................................ 10-23 10.1.6.3 pulse accumulator status and interrupt bits ............................................. 10-23 10.1.6.4 tmsk2 ?timer interrupt mask 2 register............................................... 10-23 10.1.6.5 tflg2 ?timer interrupt ?g 2 register .................................................. 10-23 11 analog-to-digital converter 11.1 overview.............................................................................................................. 11-2 11.1.1 multiplexer...................................................................................................... 11-3 11.1.2 analog converter............................................................................................ 11-3 11.1.3 digital control ................................................................................................. 11-4 11.1.4 result registers.............................................................................................. 11-4 11.1.5 a/d converter clocks ...................................................................................... 11-4 11.1.6 conversion sequence .................................................................................... 11-4 11.1.7 conversion process ....................................................................................... 11-4 11.2 a/d converter power-up and clock select ............................................................ 11-5 11.2.1 option ?system con?uration options register 1 ..................................... 11-5 11.3 channel assignments .......................................................................................... 11-7 11.3.1 single-channel operation ............................................................................... 11-7 11.3.2 multiple-channel operation............................................................................. 11-8 11.4 control, status and results registers .................................................................... 11-8 11.4.1 adctl ?a/d control and status register ..................................................... 11-8 11.4.2 adr1?dr4 ?a/d converter results registers............................................ 11-10 11.5 operation in stop and wait modes.................................................................. 11-10 a electrical specifications a.1 maximum ratings ...................................................................................................a-1 a.2 thermal characteristics and power considerations ...............................................a-1 a.3 test methods .........................................................................................................a-3 a.4 dc electrical characteristics ..................................................................................a-4 a.4.1 dc electrical characteristics ?modes of operation ........................................a-5 a.5 control timing ........................................................................................................a-5 a.5.1 peripheral port timing.......................................................................................a-9 a.5.2 pll control timing ............................................................................................a-10 tpg 13
motorola viii mc68hc11pa8 table of contents paragraph number page number title a.5.3 analog-to-digital converter characteristics....................................................... a-11 a.5.4 serial peripheral interface timing ..................................................................... a-12 a.5.5 non-multiplexed expansion bus timing ............................................................ a-15 a.6 eeprom characteristics....................................................................................... a-16 a.7 eprom characteristics ......................................................................................... a-17 b mechanical data and ordering information b.1 ordering information.............................................................................................. b-4 c development support c.1 evs ?evaluation system ....................................................................................c-1 c.2 mmds11 ?motorola modular development system ............................................c-2 c.3 spgmr11 ?serial programmer system .............................................................c-2 tpg 14
mc68hc11pa8 motorola ix list of figures figure number page number title list of figures 1-1 mc68hc11pa8/mc68hc11pb8 and MC68HC711PA8/mc68hc711pb8 block diagram................................................... 1-3 2-1 64-pin qfp pinout (mc68hc11pa8) ........................................................................ 2-1 2-2 64-pin qfp pinout (mc68hc11pb8) ....................................................................... 2-2 2-3 external reset circuitry .............................................................................................. 2-3 2-4 oscillator connections (vddsyn = 0, pll disabled) ............................................... 2-4 2-5 oscillator connections (vddsyn = 1, pll enabled)................................................ 2-5 2-6 pll circuit ................................................................................................................. 2-6 2-7 ram stand-by connections....................................................................................... 2-13 3-1 programming model ................................................................................................. 3-1 3-2 stacking operations .................................................................................................. 3-3 4-1 mc68hc11pa8/mc68hc11pb8/ MC68HC711PA8/mc68hc711pb8 memory map 4-4 4-2 ram and register overlap ......................................................................................... 4-15 5-1 processing ?w out of reset (1 of 2) ......................................................................... 5-18 5-2 processing ?w out of reset (2 of 2) ......................................................................... 5-19 5-3 interrupt priority resolution (1 of 3) ........................................................................... 5-20 5-4 interrupt priority resolution (2 of 3) ........................................................................... 5-21 5-5 interrupt priority resolution (3 of 3) ........................................................................... 5-22 5-6 interrupt source resolution within the sci subsystem .............................................. 5-23 7-1 sci baud rate generator circuit diagram................................................................... 7-1 7-2 sci block diagram .................................................................................................... 7-3 7-3 interrupt source resolution within sci....................................................................... 7-14 8-1 i 2 c bus transmission signal diagrams ...................................................................... 8-3 8-2 clock synchronization............................................................................................... 8-5 8-3 example of a typical i 2 c bus interrupt routine (sheet 1 of 2) .................................... 8-15 8-4 example of a typical i 2 c bus interrupt routine (sheet 2 of 2) .................................... 8-16 9-1 spi block diagram..................................................................................................... 9-2 9-2 spi transfer format.................................................................................................... 9-3 10-1 timer clock divider chains ...................................................................................... 10-3 10-2 capture/compare block diagram............................................................................. 10-5 10-3 pulse accumulator block diagram ........................................................................... 10-21 11-1 a/d converter block diagram................................................................................... 11-2 11-2 electrical model of an a/d input pin (in sample mode)........................................... 11-3 tpg 15
motorola x mc68hc11pa8 list of figures figure number page number title 11-3 a/d conversion sequence........................................................................................11-5 a-1 test methods ............................................................................................................ a-3 a-2 timer inputs.............................................................................................................. a- 6 a-3 reset timing ............................................................................................................. a-7 a-4 interrupt timing ......................................................................................................... a-7 a-5 stop recovery timing .............................................................................................. a-8 a-6 wait recovery timing ............................................................................................... a-8 a-7 port read timing diagram .......................................................................................... a-9 a-8 port write timing diagram.......................................................................................... a-9 a-9 spi master timing (cpha = 0).................................................................................. a-13 a-10 spi master timing (cpha = 1).................................................................................. a-13 a-11 spi slave timing (cpha = 0) .................................................................................... a-14 a-12 spi slave timing (cpha = 1) .................................................................................... a-14 a-13 expansion bus timing ............................................................................................... a-16 b-1 64-pin qfp pinout (mc68hc11pa8)........................................................................ b-1 11-4 64-pin qfp pinout (mc68hc11pb8) ....................................................................... b-2 b-2 64-pin qfp mechanical dimensions......................................................................... b-3 tpg 16
mc68hc11pa8 motorola xi list of tables ta b l e number page number title list of tables 2-1 pll mask options ..................................................................................................... 2-7 2-2 port signal functions ................................................................................................. 2-15 3-1 reset vector comparison .......................................................................................... 3-4 3-2 instruction set ........................................................................................................... 3- 9 4-1 example bootloader baud rates................................................................................ 4-3 4-2 register and control bit assignments ....................................................................... 4-7 4-3 registers with limited write access........................................................................... 4-10 4-4 hardware mode select summary.............................................................................. 4-11 4-5 ram and register remapping.................................................................................... 4-14 4-6 eeprom remapping ................................................................................................ 4-16 4-7 eeprom block protect ............................................................................................. 4-20 4-8 erase mode selection ............................................................................................... 4-25 5-1 cop timer rate select ............................................................................................... 5-2 5-2 reset cause, reset vector and operating mode ........................................................ 5-7 5-3 highest priority interrupt selection ............................................................................ 5-12 5-4 interrupt and reset vector assignments .................................................................... 5-13 5-5 stacking order on entry to interrupts ........................................................................ 5-14 6-1 port con?uration...................................................................................................... 6-1 7-1 example sci baud rate control values ..................................................................... 7-7 8-1 i 2 c bus prescaler ...................................................................................................... 8-7 9-1 spi clock rates.......................................................................................................... 9-7 10-1 timer resolution and capacity................................................................................. 10-2 10-2 rti periodic rates ................................................................................................... 10-17 10-3 pulse accumulator timing........................................................................................ 10-20 11-1 a/d converter channel assignments ....................................................................... 11-7 k-2 standard device ordering information....................................................................... b-4 k-3 custom rom device ordering information................................................................ b-4 c-1 m68hc11 development tools ................................................................................... c-1 tpg 17
motorola xii mc68hc11pa8 list of tables this page left blank intentionally tpg 18
mc68hc11pa8 motorola 1-1 introduction 1 1 introduction the mc68hc11pa8 and the mc68hc11pb8 are members of the m68hc11 family of hcmos microcontrollers. in addition to 48k bytes of rom, the mc68hc11pa8/mc68hc11pb8 contains 2k bytes of ram and 512 bytes of eeprom. the combination of large memory and state-of-the-art, power-saving timer features makes the mc68hc11pa8/mc68hc11pb8 ideal for complex, power-sensitive applications. in addition, the integrated a/d and timer systems, together with the use of the 64-pin qfp package, means that the mc68hc11pa8/mc68hc11pb8 is an excellent choice for space-critical applications. another notable feature of the device is its wide range of serial communications; in addition to an sci subsystem, the device contains an spi subsystem and an i 2 c ? serial interface. the MC68HC711PA8/mc68hc711pb8 is an eprom version of the mc68hc11pa8/ mc68hc11pb8, with the user rom replaced by a similar amount of eprom. all references to the mc68hc11pa8/mc68hc11pb8 apply equally to the MC68HC711PA8/mc68hc711pb8, unless otherwise noted. references speci? to the MC68HC711PA8/mc68hc711pb8 are italicised in the text. 1.1 features low-power, high performance m68hc11 cpu core 4.4mhz bus frequency 48k bytes of rom (mc68hc11pa8/mc68hc11pb8); 48k bytes of user eprom (MC68HC711PA8/mc68hc711pb8) 2k bytes of ram 512 bytes of byte-erasable eeprom, with on-chip charge pump non-multiplexed address and data buses power-saving pll clock generation circuit ?i 2 c bus is a proprietary philips interface bus. tpg 19
motorola 1-2 mc68hc11pa8 introduction 1 sci subsystem with modulus baud rate selection ? 2 c ? bus subsystem spi subsystem with software-selectable msb/lsb ?st option 8-bit analog to digital (a/d) converter up to 39 general-purpose i/o lines plus up to 6 input-only lines schmitt trigger input buffers on every i/o line (except ports c and e) for reduced noise sensitivity 16-bit timer with 3/4 input captures and 4/5 output compares; pulse accumulator and cop watchdog timer power saving stop and wait modes available in 64-pin qfp and 68-pin clcc packaging. clcc packaged devices are available as samples only. contact your motorola sales of?e for more information. 1.2 mask options there are ?e mask options available on the mc68hc11pa8/mc68hc11pb8. these options are programmed during manufacture and should be speci?d on the order form. por/exit from stop start-up time (4064/128 bus cycles); see section 4.3.2.4. pll oscillator frequency (32khz/614khz/2mhz and above); see section 2.5. state of the pll synthesizer program register (synr) on reset (customer de?ed); see section 2.5.4.2. security option (available/unavailable); see section 4.4.4. oscillator buffer type (inverter/schmitt trigger); see section 2.3. note: these options are not available on the MC68HC711PA8/mc68hc711pb8; on this device the por/exit from stop start-up time is 4064 bus cycles, the synr register contains $01 on reset, the security feature is available, the oscillator buffer is an inverter, and the pll oscillator is optimized for operation at frequencies of 2 mhz and above. tpg 20
mc68hc11pa8 motorola 1-3 introduction 1 figure 1-1 mc68hc11pa8/mc68hc11pb8 and MC68HC711PA8/mc68hc711pb8 block diagram pe7 pe6 pe5 pe4 pe2 pe3 port e vrh vrl ad7 ad6 ad5 ad4 ad3 ad2 8-channel a/d converter i 2 c bus scl sda pa7 pa6 pa5 pa4 pa2 pa1 pa0 pa3 pd1 pd0 pd5 pd4 pd2 pd3 pg7 oc1/pai oc1/oc2 oc1/oc3 oc1/oc4 ic4/oc1/oc5 ic1 ic2 ic3 timer cop watchdog periodic interrupt pulse accumulator port a port d port g ss sck mosi miso spi sci+ txd rxd non-multiplexed address and data buses port b port f port c a15 a14 a13 a12 a11 a10 a9 a8 a7 a6 a5 a4 a3 a2 a1 a0 d7 d6 d5 d4 d3 d2 d1 d0 pb7 pb6 pb5 pb4 pb3 pb2 pb1 pb0 pf7 pf6 pf5 pf4 pf3 pf2 pf1 pf0 pc7 pc6 pc5 pc4 pc3 pc2 pc1 pc0 xirq irq reset moda/lir modb/vstby interrupts & mode select oscillator xtal extal e xout 2 vdd vss 3 4 m68hc11 cpu pll xfc r/w 512 bytes eeprom 2k bytes ram rom or eprom 48k bytes vddsyn pe1 pe0 ad0 ad1 notes: either pins pd[4, 3] or pins pe[7, 6] may be used for the i 2 c bus. 1. the xout pin is not available on 64-pin qfp packaged devices, but it is present on the 68-pin clcc package. 2. pins pe4 and pe5 are available on the 64-pin qfp mc68hc11pb8/mc68hc711pb8 devices and on all 68-pin clcc devices. tpg 21
motorola 1-4 mc68hc11pa8 introduction 1 this page left blank intentionally tpg 22
mc68hc11pa8 motorola 2-1 pin descriptions 2 2 pin descriptions the mc68hc11pa8/mc68hc11pb8 and MC68HC711PA8/mc68hc711pb8 are available packaged in a 64-pin quad ?t pack (qfp). windowed samples however, are only available in a 68-pin clcc. most pins on this mcu serve two or more functions, as described in the following paragraphs. refer to figure 2-1 and figure 2-2, which show the pin assignments in the 64-pin package for the mc68hc11pa8 and mc68hc11pb8 respectively. figure 2-1 64-pin qfp pinout (mc68hc11pa8) pc4/d4 pc5/d5 pc7/d7 17 18 20 21 22 23 24 25 26 27 29 19 pd1/txd pd2/miso pd3/mosi/sda pd4/sck/scl pd5/ss vss vddex vdd pa7/pai/oc1 pb7/a15 pb6/a14 pb4/a12 pb3/a11 pb2/a10 pb1/a9 vddsyn xfc pe7/ad7/scl pe6/ad6/sda xirq / vppe pb5/a13 pd0/rxd moda/lir reset xtal extal e pc6/d6 pc3/d3 pc2/d2 modb/vstby 1 2 4 5 6 7 8 9 10 11 12 13 3 pb0/a8 28 64 63 61 60 59 58 56 55 54 53 52 62 57 pa3/oc5/ic4/oc1 pc1/d1 pa6/oc2/oc1 pa5/oc3/oc1 pa4/oc4/oc1 14 15 16 30 31 32 51 50 49 pc0/d0 pf0/a0 pa2/ic1 pa1/ic2 pa0/ic3 48 47 46 45 44 43 42 41 40 pf1/a1 pf2/a2 pf4/a4 pf5/a5 pf6/a6 pf7/a7 vss vssad vrh vrl pe0/ad0 pe1/ad1 pf3/a3 36 39 38 37 pe2/ad2 pe3/ad3 vssex 35 34 33 pg7/r/w irq vddad tpg 23
motorola 2-2 mc68hc11pa8 pin descriptions 2 2.1 vdd and vss power is supplied to the microcontroller via these pins. vdd is the positive supply and vss is ground. the mcu operates from a single 5v (nominal) power supply. it is in the nature of cmos designs that very fast signal transitions occur on the mcu pins. these short rise and fall times place very high short-duration current demands on the power supply. to prevent noise problems, special care must be taken to provide good power supply bypassing at the mcu. bypass capacitors should have good high-frequency characteristics and be as close to the mcu as possible. bypassing requirements vary, depending on how heavily the mcu pins are loaded. the 64-pin packaged device has three vdd pins and four vss pins (two vss pins on the mc68hc11pb8). these pins supply power to the adc and to the internal logic and port logic on each half of the chip. figure 2-2 64-pin qfp pinout (mc68hc11pb8) pc4/d4 pc5/d5 pc7/d7 17 18 20 21 22 23 24 25 26 27 29 19 pd1/txd pd2/miso pd3/mosi/sda pd4/sck/scl pd5/ss vss vddex vdd pa7/pai/oc1 pb7/a15 pb6/a14 pb4/a12 pb3/a11 pb2/a10 pb1/a9 vddsyn xfc pe7/ad7/scl pe6/ad6/sda xirq / vppe pb5/a13 pd0/rxd moda/lir reset xtal extal e pc6/d6 pc3/d3 pc2/d2 modb/vstby 1 2 4 5 6 7 8 9 10 11 12 13 3 pb0/a8 28 64 63 61 60 59 58 56 55 54 53 52 62 57 pa3/oc5/ic4/oc1 pc1/d1 pa6/oc2/oc1 pa5/oc3/oc1 pa4/oc4/oc1 14 15 16 30 31 32 51 50 49 pc0/d0 pf0/a0 pa2/ic1 pa1/ic2 pa0/ic3 48 47 46 45 44 43 42 41 40 pf1/a1 pf2/a2 pf4/a4 pf5/a5 pf6/a6 pf7/a7 vss/vssad vrh vrl pe0 pe1 pe2 pf3/a3 36 39 38 37 pe3 pe4 pe5 35 34 33 pg7/r/w irq vddad tpg 24
mc68hc11pa8 motorola 2-3 pin descriptions 2 2.2 reset an active low bidirectional control signal, reset , acts as an input to initialize the mcu to a known start-up state. it also acts as an open-drain output to indicate that an internal failure has been detected in either the clock monitor or the cop watchdog circuit. the cpu distinguishes between internal and external reset conditions by sensing whether the reset pin rises to a logic one in less than four e clock cycles after an internal reset has been released. it is therefore not advisable to connect an external resistor-capacitor (rc) power-up delay circuit to the reset pin of m68hc11 devices because the circuit charge time constant can cause the device to misinterpret the type of reset that occurred. refer to section 5 for further information. figure 2-3 illustrates a typical reset circuit that includes an external switch together with a low voltage inhibit circuit, to prevent power transitions or ram or eeprom corruption. 2.3 crystal driver and external clock input (xtal, extal) these two pins provide the interface for either a crystal or a cmos compatible clock to control the internal clock generator circuitry. if the pll circuit is not being used to provide the e clock, the frequency applied to these pins must be four times higher than the desired e clock rate. figure 2-4 figure 2-3 external reset circuitry v dd 1 m f v dd 4.7 k w to m68hc11 reset v dd 1 2 3 1 2 3 in reset gnd in reset gnd mc34064 mc34164 manual reset 4.7 k w 4.7 k w tpg 25
motorola 2-4 mc68hc11pa8 pin descriptions 2 shows oscillator connections that should be used when the pll is disabled, and figure 2-5 shows the connections that should be used when the pll is enabled. the xtal pin is normally left unconnected when an external cmos compatible clock input is connected to the extal pin. the xtal output is normally intended to drive only a crystal. the xtal output can be buffered with a high-impedance buffer, or it can be used to drive the extal input of another m68hc11 family device (unless the pll circuit is in use). on the mc68hc11pa8/mc68hc11pb8, the type of internal crystal oscillator buffer is determined by a mask option; it can be either an inverter or a schmitt trigger. use of the schmitt trigger type reduces problems caused by noise, in particular with slow clocks. at crystal power-up, the schmitt trigger will only generate internal clocks when the crystal amplitude is suf?ient. however, this type of buffer requires a larger xtal amplitude and is not recommended for use with high frequency crystals, especially if a second mcu is to be driven. this option is not available on the MC68HC711PA8/mc68hc711pb8, on which the crystal oscillator buffer is an inverter. in all cases, use caution when designing circuitry associated with the oscillator pins. figure 2-4 oscillator connections (vddsyn = 0, pll disabled) 10 m w c 1 4? crystal c 2 extal xtal m68hc11 note: capacitor values include all stray capacitance. m68hc11 extal xtal nc external oscillator 10 m w c 1 4? crystal c 2 extal xtal m68hc11 m68hc11 extal xtal nc 220 w (a) common crystal connections (b) external oscillator connections (c) one crystal driving two mcus tpg 26
mc68hc11pa8 motorola 2-5 pin descriptions 2 2.4 e clock output (e) e is the output connection for the internally generated e clock. the signal from e is used as a timing reference. the frequency of the e clock output is one quarter that of the input frequency at the xtal and extal pins (except when the pll is used as the clock source). when e clock output is low, an internal process is taking place; when it is high, data is being accessed. all clocks, including the e clock, are halted when the mcu is in stop mode. the e clock output can be turned off in single-chip modes to reduce the effects of rfi (see section 4.3.2.5). figure 2-5 oscillator connections (vddsyn = 1, pll enabled) 22 m w c 1 crystal c 2 extal xtal m68hc11 note: capacitor values include all stray capacitance. m68hc11 extal xtal nc external oscillator (a) common crystal connections (c) external oscillator 390 k w (32 to 38.4 khz crystal) (b) common crystal connections (500 to 16000 khz crystal) 10 m w c 1 crystal c 2 extal xtal m68hc11 note: all values of capacitance and resistance shown are approximate; exact values must be calculated knowing the crystal param eters and the expected voltage and temperature ranges; as a guide c 1 = c 2 ? 0.5 x crystal capacitance. connections tpg 27
motorola 2-6 mc68hc11pa8 pin descriptions 2 2.5 phase-locked loop (xfc, vddsyn) the xfc and vddsyn pins are the inputs for the on-chip pll (phase-locked loop) circuitry. on reset, all system clocks are derived from the internal extal signal (extali). if enabled (vddsyn high), the pll uses the extali frequency as a reference to generate a clock frequency that can be varied under software control. the user may choose to use the pll output instead of extali as the source clock for the system. the pll consists of a variable bandwidth loop ?ter, a voltage controlled oscillator (vco), a feedback frequency divider and a digital phase detector. pll functions are controlled by the pllcr and synr registers. a block diagram of the pll circuit is shown in figure 2-6; refer also to figure 10-1. figure 2-6 pll circuit bus clock select module clock select frequency divider synr phase detect loop ?ter vco f ref pcomp f fb mcs st4xck 4xclk bcs to clock generation circuitry for sci and timer vcoout extali st op extal xtal & xfc vddsyn v ddsyn external connection c xfc key: 0.1 m f 0.01 m f extali xout clock select ext4x xout note: the xout pin is not present on 64-pin packaged devices. it is present on 68-pin clcc packaged versions of the MC68HC711PA8 and mc68hc711pb8, which are available as samples only. contact your local sales of?e for further information. tpg 28
mc68hc11pa8 motorola 2-7 pin descriptions 2 2.5.1 pll operation the voltage controlled oscillator (vco) generates the pll output frequency vcoout. this signal is fed back through a frequency divider, which divides the signal frequency by a factor determined by the contents of the synr register, to produce the feedback signal f fb . this signal is input to the phase detector along with the reference signal, f ref . the phase detector generates a control signal (pcomp) which is a function of the phase difference between f fb and f ref . pcomp is then integrated, and the resultant dc voltage (visible on xfc) is applied to the vco, modifying the output signal vcoout to lock it in phase with f ref . note: because the operation of the pll depends on repeated adjustments to the voltage input to the vco, a time t plls is required for the stabilization of the output frequency. the state of two bits in the pllcr register, mcs and bcs, determine whether vcoout or extali is used for the system clocks. a mask option on the mc68hc11pa8/mc68hc11pb8 allows the pll circuit to be optimized for operation in one of three frequency ranges, as shown in table 2-1. (this option is not available on the MC68HC711PA8/mc68hc711pb8; on this device the pll is optimized for operation at frequencies of 2 mhz and above) . input frequencies other than those included in table 2-1 can be used. however, for options one or two, at operation above the maximum frequency speci?d, vddsyn should be grounded to disable the pll and enable the high frequency oscillator circuit. in this state, the oscillator is designed to operate at frequencies up to 16 mhz and xfc may be left unconnected. refer also to figure 2-5. vddsyn is the power supply pin for the pll and should be suitably bypassed. connecting it high enables the internal low frequency oscillator circuitry designed for the pll. the external capacitor on xfc (c xfc ) should be located as close to the chip as possible to minimize noise. in general, a larger capacitor will improve the plls frequency stability, at the expense of increasing the time required for it to settle (t plls ) at the desired frequency. a capacitor value of 47nf is usually adequate for 32khz or 614khz applications, while a 4.7nf capacitor is suitable for 4 mhz applications. the pll ?ter has two bandwidths that can be manually selected under control of the bwc bit in pllcr. whenever the pll is ?st enabled, the wide bandwidth mode should be used, to enable table 2-1 pll mask options characteristic mask option 1 mask option 2 mask option 3 typical input frequency 32 khz 614 khz 4 mhz maximum input frequency 50 khz 2 mhz 16 mhz tpg 29
motorola 2-8 mc68hc11pa8 pin descriptions 2 the pll frequency to ramp up quickly. after a time t plls has elapsed, the ?ter can be switched to the narrow bandwidth mode, to make the ?al frequency more stable. caution: bit 5 of the pllcr (auto) must be cleared before an attempt is made to use bwc; manual bandwidth control should always be used. 2.5.2 synchronization of pll with subsystems if the mcs bit in pllcr is set, then the sci and timer clocks run off the pll output (4xclk) as does the cpu. if mcs is cleared, then the timer and sci subsystems operate off the extali frequency, but are accessed by the cpu relative to the internal ph2 signal. in this case, although extali is used as the reference for the pll, the ph2 clock and the module clocks for the timer and the sci are not synchronized. in order to ensure synchronized data, special circuitry has been incorporated into both subsystems. 2.5.3 changing the pll frequency the pll output frequency can be changed by altering the contents of the synr register (see section 2.5.4.2). to prevent possible bursts of high frequency operation during the recon?uration of the pll, the following sequence should be performed: 1) switch to the low frequency bus rate (bcs = 0). 2) disable the pll (pllon = 0). 3) change the value in synr. 4) enable the pll (pllon = 1). 5) wait a time t plls for the pll frequency to stabilize. 6) switch to the high frequency bus rate (bcs = 1). 2.5.4 pll registers two registers are used to control the operation of the mc68hc11pa8/mc68hc11pb8 phase locked loop circuitry. these are the pll control register and the synthesizer program register, each of which is described in the following paragraphs. tpg 30
mc68hc11pa8 motorola 2-9 pin descriptions 2 2.5.4.1 pllcr ?pll control register this read/write register contains two bits that are used to enable and disable the synthesizer and to switch from slow (extali) to one of the fast speeds. two other bits are used to control the ?ter bandwidth. the sci, timer clock source and the slow clock for wait mode are also controlled by this register. pllon ?pll on 1 (set) switch pll on. 0 (clear) switch pll off. this bit activates the synthesizer circuit without connecting it to the control circuit. this allows the circuit to stabilize before it drives the cpu clocks. on reset, pllon is forced low if the vddsyn supply is low. if vddsyn is at v dd , pllon is set by reset to allow the control loop to stabilize during power-up. pllon cannot be cleared whilst using vcoout to drive the internal processor clock, i.e. when bcs is set. bcs ?bus clock select 1 (set) vcoout output drives the clock circuit (4xclk). 0 (clear) extali drives the clock circuit (4xclk). this bit determines which signal drives the clock circuit generating the bus clocks. once bcs has been altered it can take up to [1.5 extali + 1.5 vcoout] cycles for the change in the clock to occur. reset clears this bit. note: pllon and bcs have built-in safeguards so that vcoout cannot be selected as the clock source (bcs = 1) if the pll is off (pllon = 0). similarly, the pll cannot be turned off (pllon = 0) if it is on and in use (bcs = 1). turning the pll on and selecting vcoout as the clock source therefore requires two independent writes to pllcr. auto ?automatic bandwidth control (test mode only) 1 (set) automatic bandwidth control selected. 0 (clear) manual bandwidth control selected. reset sets this bit. caution: this bit must be cleared before an attempt is made to use bwc; manual bandwidth control should always be used. address bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 state on reset pll control (pllcr) $002e pllon bcs auto bwc vcot mcs 0 wen x011 1000 tpg 31
motorola 2-10 mc68hc11pa8 pin descriptions 2 bwc ?bandwidth control 1 (set) wide (high and low) bandwidth control selected. 0 (clear) narrow (low) bandwidth control selected. bandwidth selection can only be controlled by bwc when auto is cleared. after the pll is ?st enabled, or after a change in frequency, a delay of t plls is required before clearing bwc. the low bandwidth driver is always enabled, so this bit determines whether the high bandwidth driver is on or off. reset sets this bit. vcot ?vco test (test mode only) 1 (set) loop ?ter operates as speci?d by auto and bwc. 0 (clear) low bandwidth mode of the pll ?ter is disabled. this bit is used to isolate the loop ?ter from the vco for testing purposes. vcot is always set in user modes. this bit is writable only in bootstrap and test modes. reset sets this bit. mcs ?module clock select 1 (set) 4xclk is the source for the sci and timer divider chain. 0 (clear) extali is the source for the sci and timer divider chain. reset clears this bit. bit 1 not implemented; always reads zero wen ?wait enable 1 (set) low-power wait mode selected (pll set to ?dle in wait mode). 0 (clear) do not alter 4xclk during wait mode. this bit determines whether the 4xclk is disconnected from vcoout during wait and connected to extali. reset clears this bit. when wen is set, the cpu will respond to a wait instruction by ?st stacking the relevant registers, then by clearing bcs and setting the pll to ?dle? with modulus = 1. bwc is set so that the wide bandwidth control is selected. any interrupt, any reset, or the assertion of raf (receiver active ?g) in the sci will allow the pll to resume operating at the frequency speci?d in the synr. the user must set bcs after the pll has had time to adjust (t plls ). if the sci re bit (receiver enable bit) is clear, then raf cannot become set, hence the pll will not resume normal operation. for a description of raf and re, see section 7. tpg 32
mc68hc11pa8 motorola 2-11 pin descriptions 2 2.5.4.2 synr ?synthesizer program register the pll frequency synthesizer multiplies the frequency of the input oscillator. the multiplication factor is software programmable via a loop divider, which consists of a six-bit modulo n counter, with a further two bit scaling factor. on the mc68hc11pa8/mc68hc11pb8, the state of the synr register on reset is de?ed by the customer as a mask option, and should be detailed on the order form. on the MC68HC711PA8/mc68hc711pb8, the state of synr on reset is always $01, giving a multiplication factor of four. the multiplication factor is given by 2(y + 1)2 x , where 0 x 3 and 0 y 63. bits in synr can be read at any time but can only be written if pllon = 0. note: exceeding recommended operating frequencies can result in indeterminate mcu operation. synx[1:0] these bits program the binary taps (divide by 1, 2, 4 and 8). syny[5:0] these bits program the six-bit modulo n (1 to 64) counter. note: the resolution of the multiplication factors decreases by a factor of two, as x increases: address bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 state on reset synthesizer program (synr) $002f synx1 synx0 syny5 syny4 syny3 syny2 syny1 syny0 mask option x y possible multipliers 0 0 ?63 2, 4, 6, 8, ? 128 1 0 ?63 4, 8, 12, 16, ? 256 2 0 ?63 8, 16, 24, 32, ? 512 3 0 ?63 16, 32, 48, 64, ? 1024 tpg 33
motorola 2-12 mc68hc11pa8 pin descriptions 2 2.6 interrupt request (irq ) the irq input provides a means of applying asynchronous interrupt requests to the mcu. either falling-edge-sensitive triggering or level-sensitive triggering is program selectable (option register). irq is always con?ured to level-sensitive-triggering at reset. a read of the ipin bit in the spcr register returns the logic level present on the irq pin (see section 9.5.1). therefore, the irq pin can be used as an input pin; interrupts can be masked by the i-bit in the ccr register. note: connect an external pull-up resistor, typically 4.7 k w , to v dd when irq is used in a level sensitive wired-or con?uration. see also section 2.7. 2.7 nonmaskable interrupt (xirq / vppe ) the xirq input provides a means of requesting a nonmaskable interrupt after reset initialization. either falling-edge-sensitive triggering or level-sensitive triggering is program selectable (opt2 register). xirq is always con?ured to level-sensitive-triggering at reset. during reset, the x bit in the condition code register (ccr) is set and any interrupt is masked until mcu software enables it. xirq is often used as a power loss detect interrupt. on the MC68HC711PA8/mc68hc711pb8, the vppe pin is used to input the external eprom programming voltage, which must be present during eprom programming. irq and xirq must be configured for level sensitive operation if there is more than one source of interrupt. whenever xirq or irq is used with multiple interrupt sources, each source must drive the interrupt input with an open-drain type of driver to avoid contention between outputs. there should be a single pull-up resistor near the mcu interrupt input pin (typically 4.7 k w ). there must also be an interlock mechanism at each interrupt source so that the source holds the interrupt line low until the mcu recognizes and acknowledges the interrupt request. if one or more interrupt source is still pending after the mcu services a request, the interrupt line will still be held low and the mcu will be interrupted again as soon as the interrupt mask bit in the mcu is cleared (normally upon return from an interrupt). refer to section 5. a read of the xpin bit in the spcr register returns the logic level present on the xirq pin (see section 9.5.1). therefore, the xirq pin can be used as an input pin; xirq interrupts can be masked by the x bit in the ccr register. tpg 34
mc68hc11pa8 motorola 2-13 pin descriptions 2 2.8 moda and modb (moda/lir and modb/vstby) during reset, moda and modb select one of the four operating modes. refer to section 4. after the operating mode has been selected, the lir pin provides an open-drain output (driven low) to indicate that execution of an instruction has begun. in order to detect consecutive instructions in a high-speed application, this signal drives high for a short time to prevent false triggering. a series of e clock cycles occurs during execution of each instruction. the lir signal goes low during the ?st e clock cycle of each instruction (opcode fetch). this output is provided for assistance in program debugging and its operation is controlled by the lirdv bit in the opt2 register. the vstby pin is used to input ram stand-by power. the mcu is powered from the vdd pin unless the difference between the level of vstby and vdd is greater than one mos threshold (about 0.7 volts). when these voltages differ by more than 0.7 volts, the internal ram and part of the reset logic are powered from vstby rather than vdd. this allows ram contents to be retained without vdd power applied to the mcu. reset must be driven low before v dd is removed and must remain low until v dd has been restored to a valid level. 2.9 vrh and vrl these pins provide the reference voltages for the analog-to-digital converter. 2.10 pg7/r/w this pin provides two separate functions, depending on the operating mode. in single chip and bootstrap modes, pg7/r/w acts as input/output port g bit 7. refer to section 6 for further information. in expanded and test modes, pg7/r/w performs the read/write function. pg7/r/w signals the direction of transfers on the external data bus. a high on this pin indicates that a read cycle is in progress. figure 2-7 ram stand-by connections 4.7k w (+) 4.8 v nicd v dd v dd v out v batt max 690 to modb/vstby pin of m68hc11 tpg 35
motorola 2-14 mc68hc11pa8 pin descriptions 2 2.11 port signals the mc68hc11pa8/mc68hc11pb8 includes 45 pins that are arranged into ?e 8-bit ports (a, b, c, e and f), one 6-bit port (d) and one 1-bit port (g). ? ports a, b, c, d, f and g are fully bidirectional; port e pins are input only, except for port e[7, 6] which may be used as i/o lines for the i 2 c bus system. each of the bidirectional ports serves a purpose other than i/o, depending on the operating mode or peripheral function selected. note that ports b, c, f, and g are available for i/o functions only in single chip and bootstrap modes. refer to table 2-2 for details of the port signals functions in different operating modes. note: when using the information about port functions, do not confuse pin function with the electrical state of the pin at reset. all general purpose i/o pins con?ured as inputs at reset are in a high-impedance state. port data registers re?ct the functional state of the port at reset. the pin function is mode dependent. 2.11.1 port a port a is an 8-bit general purpose i/o port with a data register (porta) and a data direction register (ddra). port a pins share functions with the 16-bit timer system (see section 10 for further information). porta can be read at any time and always returns the pin level. if written, porta stores the data in internal latches. the pins are driven only if they are con?ured as outputs. writes to porta do not change the pin state when the pins are con?ured for timer output compares. out of reset, port a pins [7:0] are general purpose high-impedance inputs. when the functions associated with these pins are disabled, the bits in ddra govern the i/o state of the associated pin. for further information, refer to section 6. 2.11.2 port b port b is an 8-bit general purpose i/o port with a data register (portb) and a data direction register (ddrb). in single chip mode, port b pins are general purpose i/o pins (pb[7:0]). in expanded mode, port b pins act as the high-order address lines (a[15:8]) of the address bus. portb can be read at any time and always returns the pin level. if portb is written, the data is stored in internal latches. the pins are driven only if they are con?ured as outputs in single chip or bootstrap mode. for further information, refer to section 6. ? pins pe5 and pe4 are not present on 64-pin qfp mc68hc11pa8 packed devices. they are present on 64-pin qfp mc68hc11pb8 devices and also on 68-pin clcc packaged versions of the MC68HC711PA8/mc68hc711pb8, which are available as samples only. contact your local motorola sales of?e for more information. tpg 36
mc68hc11pa8 motorola 2-15 pin descriptions 2 port b pins include on-chip pull-up devices which can be enabled or disabled via the port pull-up assignment register (ppar). 2.11.3 port c port c is an 8-bit general purpose i/o port with a data register (portc) and a data direction register (ddrc). in single chip mode, port c pins are general purpose i/o pins (pc[7:0]). in the expanded mode, port c pins are con?ured as data bus pins (d[7:0]). portc can be read at any time; inputs return the pin level and outputs return the pin driver input level. if portc is written, the data is stored in internal latches. the pins are driven only if they are con?ured as outputs in single chip or bootstrap mode. port c pins are general purpose inputs out of reset in single chip and bootstrap modes. in expanded and test modes, these pins are data bus lines out of reset. the cwom control bit in the opt2 register disables port cs p-channel output drivers. because the n-channel driver is not affected by cwom, setting cwom causes port c to become an open-drain-type output port suitable for wired-or operation. in wired-or mode (portc bits at logic level zero), the pins are actively driven low by the n-channel driver. when a port c bit is at table 2-2 port signal functions port/bit single chip and bootstrap mode expanded multiplexed and special test mode pa7 pa7/pai and/or oc1 pa6 pa6/oc2 and/or oc1 pa5 pa5/oc3 and/or oc1 pa4 pa4/oc4 and/or oc1 pa3 pa3/oc5/ic4 and/or oc1 pa2 pa2/ic1 pa1 pa1/ic2 pa0 pa0/ic3 pb[7:0] pb[7:0] a[15:8] pc[7:0] pc[7:0] d[7:0] pd5 pd5/ss pd4 pd4/sck/scl pd3 pd3/mosi/sda pd2 pd2/miso pd1 pd1/txd pd0 pd0/rxd pe7 input only/analog inputs/scl pe6 input only/analog inputs/sda pe[5:0] ? input only/analog inputs pf[7:0] pf[7:0] a[7:0] pg7 pg7 r/w tpg 37
motorola 2-16 mc68hc11pa8 pin descriptions 2 logic level one, the associated pin is in a high impedance state as neither the n-channel nor the p-channel devices are active. it is customary to have an external pull-up resistor on lines that are driven by open-drain devices. port c can only be con?ured for wired-or operation when the mcu is in single chip mode. for further information, refer to section 6. 2.11.4 port d port d, a 6-bit general purpose i/o port, has a data register (portd) and a data direction register (ddrd). the six port d lines (d[5:0]) can be used for general purpose i/o, for the serial communications interface (sci, pins [1,0]) and for either the serial peripheral interface (spi, pins [5:2]) or the i 2 c bus system (pins [4, 3]). portd can be read at any time; inputs return the pin level and outputs return the pin driver input level. if portd is written, the data is stored in internal latches. the pins are driven only if port d is con?ured for general purpose output. the dwom bit in spcr disables the p-channel output drivers of pins d[5:2], and the woms bit in sccr1 disables those of pins d[1,0]. because the n-channel driver is not affected by dwom or woms, setting either bit causes the corresponding port d pins to become open-drain-type outputs suitable for wired-or operation. in wired-or mode (portd bits at logic level zero), the pins are actively driven low by the n-channel driver. when a port d bit is at logic level one, the associated pin is in a high impedance state as neither the n-channel nor the p-channel devices are active. it is customary to have an external pull-up resistor on lines that are driven by open-drain devices. port d can be con?ured for wired-or operation when the mcu is in single chip or expanded mode. for further information, refer to section 6, section 7 (sci), section 8 (i 2 c) and section 9 (spi). 2.11.5 port e port e pins can be used as the analog inputs for the analog-to-digital converter, or as general-purpose inputs. pins pe[7, 6] may alternatively be used as the i/o pins for the i 2 c bus, depending on the state of the mbsp bit in the config register. for further information, refer to section 6, section 8 (i 2 c bus) and section 11 (a/d). tpg 38
mc68hc11pa8 motorola 2-17 pin descriptions 2 2.11.6 port f port f is an 8-bit general purpose i/o port with a data register (portf) and a data direction register (ddrf). in single chip mode, port f pins are general purpose i/o pins (pf[7:0]). in expanded mode, port f pins act as the low-order address lines (a[7:0]) of the address bus. portf can be read at any time and always returns the pin level. if portf is written, the data is stored in internal latches. the pins are driven only if they are con?ured as outputs in single chip or bootstrap mode. port f pins include on-chip pull-up devices that can be enabled or disabled via the port pull-up assignment register (ppar). for further information, refer to section 6. 2.11.7 port g in single-chip and bootstrap modes, port g is a 1-bit general purpose i/o port with a data register (portg) and a data direction register (ddrg). in expanded mode, pg7 is the r/w signal. portg can be read at any time in single-chip and bootstrap modes; when an input, it returns the pin level, and when an output, it returns the pin driver input level. if portg is written, the data is stored into an internal latch. the pin is driven only if it is con?ured as an output. pg7 includes an on-chip pull-up device that can be enabled or disabled via the port pull-up assignment register (ppar). for further information, refer to section 6. tpg 39
motorola 2-18 mc68hc11pa8 pin descriptions 2 this page left blank intentionally tpg 40
mc68hc11pa8 motorola 3-1 cpu core and instruction set 3 3 cpu core and instruction set this section discusses the m68hc11 central processing unit (cpu) architecture, its addressing modes and the instruction set. for more detailed information on the instruction set, refer to the m68hc11 reference manual (m68hc11rm/ad) . the cpu is designed to treat all peripheral, i/o and memory locations identically, as addresses in the 64kbyte memory map. this is referred to as memory-mapped i/o. there are no special instructions for i/o that are separate from those used for memory. this architecture also allows accessing an operand from an external memory location with no execution-time penalty. 3.1 registers m68hc11 cpu registers are an integral part of the cpu and are not addressed as if they were memory locations. the seven registers are shown in figure 3-1 and are discussed in the following paragraphs. figure 3-1 programming model accumulator a 7 0 accumulator b 70 double accumulator d 15 0 index register x 15 0 index register y 15 0 stack pointer 15 0 program counter 15 0 sc xh i nzv a:b d ix iy sp pc ccr condition code register carry over?w zero negative i interrupt mask half carry (from bit 3) x interrupt mask stop disable tpg 41
motorola 3-2 mc68hc11pa8 cpu core and instruction set 3 3.1.1 accumulators a, b and d accumulators a and b are general purpose 8-bit registers that hold operands and results of arithmetic calculations or data manipulations. for some instructions, these two accumulators are treated as a single double-byte (16-bit) accumulator called accumulator d. although most operations can use accumulators a or b interchangeably, the following exceptions apply: the abx and aby instructions add the contents of 8-bit accumulator b to the contents of 16-bit register x or y, but there are no equivalent instructions that use a instead of b. the tap and tpa instructions transfer data from accumulator a to the condition code register, or from the condition code register to accumulator a, however, there are no equivalent instructions that use b rather than a. the decimal adjust accumulator a (daa) instruction is used after binary-coded decimal (bcd) arithmetic operations, but there is no equivalent bcd instruction to adjust accumulator b. the add, subtract, and compare instructions associated with both a and b (aba, sba, and cba) only operate in one direction, making it important to plan ahead to ensure the correct operand is in the correct accumulator. 3.1.2 index register x (ix) the ix register provides a 16-bit indexing value that can be added to the 8-bit offset provided in an instruction to create an effective address. the ix register can also be used as a counter or as a temporary storage register. 3.1.3 index register y (iy) the 16-bit iy register performs an indexed mode function similar to that of the ix register. however, most instructions using the iy register require an extra byte of machine code and an extra cycle of execution time because of the way the opcode map is implemented. refer to section 3.3 for further information. 3.1.4 stack pointer (sp) the m68hc11 cpu has an automatic program stack. this stack can be located anywhere in the address space and can be any size up to the amount of memory available in the system. normally the sp is initialized by one of the ?st instructions in an application program. the stack is con?ured as a data structure that grows downward from high memory to low memory. each time a new byte is pushed onto the stack, the sp is decremented. each time a byte is pulled from the stack, the sp is incremented. at any given time, the sp holds the 16-bit address of the next free location in the stack. figure 3-2 is a summary of sp operations. tpg 42
mc68hc11pa8 motorola 3-3 cpu core and instruction set 3 figure 3-2 stacking operations $9d = jsr main program jsr, jump to subroutine pc direct dd ff main program next instruction rtn $ad = jsr pc next instruction rtn $18 = pre pc main program $ad = jsr ff next instruction rtn $bd = jsr pc hh ll next instruction rtn main program $8d = bsr pc rr main program next instruction rtn bsr, branch to subroutine $39 = rts pc main program ind, x ind, y extend rtn l sp rtn h sp? sp? stack rtn l sp rtn h sp? sp? stack rtn l sp+2 rtn h sp+1 sp stack $3b = rti pc sp condition code sp+1 rti, return from interrupt interrupt program stack accumulator b sp+2 accumulator a sp+3 index register (ix h ) sp+4 index register (ix l ) sp+5 index register (iy h ) sp+6 index register (iy l ) sp+7 rtn h sp+8 rtn l sp+9 $3f = swi pc rtn sp? condition code sp? main program stack accumulator b sp? accumulator a sp? index register (ix h ) sp? index register (ix l ) sp? index register (iy h ) sp? index register (iy l ) sp? rtn h sp? swi, software interrupt rtn l sp wai, wait for interrupt $3e = wai pc rtn main program rts, return from subroutine legend rtn address of the next instruction in the main program, to be executed on return from subroutine rtn h more signi?ant byte of return address rtn l less signi?ant byte of return address shaded cells show stack pointer position after the operation is complete dd 8-bit direct address ($0000?00ff); the high byte is assumed to be $00 ff 8-bit positive offset ($00 to $ff (0 to 256)) is added to the index register contents hh high order byte of 16-bit extended address ll low order byte of 16-bit extended address rr signed relative offset ($80 to $7f (?28 to +127)); offset is relative to the address following the offset byte tpg 43
motorola 3-4 mc68hc11pa8 cpu core and instruction set 3 when a subroutine is called by a jump to subroutine (jsr) or branch to subroutine (bsr) instruction, the address of the instruction after the jsr or bsr is automatically pushed onto the stack, less signi?ant byte ?st. when the subroutine is ?ished, a return from subroutine (rts) instruction is executed. the rts pulls the previously stacked return address from the stack, and loads it into the program counter. execution then continues at this recovered return address. when an interrupt is recognized, the current instruction ?ishes normally, the return address (the current value in the program counter) is pushed onto the stack, all of the cpu registers are pushed onto the stack, and execution continues at the address speci?d by the vector for the interrupt. at the end of the interrupt service routine, an rti instruction is executed. the rti instruction causes the saved registers to be pulled off the stack in reverse order. program execution resumes at the return address. there are instructions that push and pull the a and b accumulators and the x and y index registers. these instructions are often used to preserve program context. for example, pushing accumulator a onto the stack when entering a subroutine that uses accumulator a, and then pulling accumulator a off the stack just before leaving the subroutine, ensures that the contents of a register will be the same after returning from the subroutine as it was before starting the subroutine. 3.1.5 program counter (pc) the program counter, a 16-bit register, contains the address of the next instruction to be executed. after reset, the program counter is initialized from one of six possible vectors, depending on operating mode and the cause of reset. 3.1.6 condition code register (ccr) this 8-bit register contains ?e condition code indicators (c, v, z, n, and h), two interrupt masking bits, (irq and xirq) and a stop disable bit (s). in the m68hc11 cpu, condition codes are automatically updated by most instructions. for example, load accumulator a (ldaa) and store accumulator a (staa) instructions automatically set or clear the n, z, and v condition code ?gs. pushes, pulls, add b to x (abx), add b to y (aby), and transfer/exchange instructions do not affect the condition codes. refer to table 3-2, which shows the condition codes that are affected by a particular instruction. table 3-1 reset vector comparison por or reset pin clock monitor cop watchdog normal $fffe, $ffff $fffc, $fffd $fffa, $fffb test or boot $bffe, $bfff $bffe, $bfff $bffe, $bfff tpg 44
mc68hc11pa8 motorola 3-5 cpu core and instruction set 3 3.1.6.1 carry/borrow (c) the c-bit is set if the arithmetic logic unit (alu) performs a carry or borrow during an arithmetic operation. the c-bit also acts as an error ?g for multiply and divide operations. shift and rotate instructions operate with and through the carry bit to facilitate multiple-word shift operations. 3.1.6.2 over?w (v) the over?w bit is set if an operation causes an arithmetic over?w. otherwise, the v-bit is cleared. 3.1.6.3 zero (z) the z-bit is set if the result of an arithmetic, logic, or data manipulation operation is zero. otherwise, the z-bit is cleared. compare instructions do an internal implied subtraction and the condition codes, including z, re?ct the results of that subtraction. a few operations (inx, dex, iny, and dey) affect the z-bit and no other condition ?gs. for these operations, only = and 1 conditions can be determined. 3.1.6.4 negative (n) the n-bit is set if the result of an arithmetic, logic, or data manipulation operation is negative; otherwise, the n-bit is cleared. a result is said to be negative if its most signi?ant bit (msb) is set (msb = 1). a quick way to test whether the contents of a memory location has the msb set is to load it into an accumulator and then check the status of the n-bit. 3.1.6.5 interrupt mask (i) the interrupt request (irq) mask (i-bit) is a global mask that disables all maskable interrupt sources. while the i-bit is set, interrupts can become pending, but the operation of the cpu continues uninterrupted until the i-bit is cleared. after any reset, the i-bit is set by default and can only be cleared by a software instruction. when an interrupt is recognized, the i-bit is set after the registers are stacked, but before the interrupt vector is fetched. after the interrupt has been serviced, a return from interrupt instruction is normally executed, restoring the registers to the values that were present before the interrupt occurred. normally, the i-bit is zero after a return from interrupt is executed. although the i-bit can be cleared within an interrupt service routine, ?esting interrupts in this way should only be done when there is a clear understanding of latency and of the arbitration mechanism. refer to section 5. tpg 45
motorola 3-6 mc68hc11pa8 cpu core and instruction set 3 3.1.6.6 half carry (h) the h-bit is set when a carry occurs between bits 3 and 4 of the arithmetic logic unit during an add, aba, or adc instruction. otherwise, the h-bit is cleared. half carry is used during bcd operations. 3.1.6.7 x interrupt mask (x) the xirq mask (x) bit disables interrupts from the xirq pin. after any reset, x is set by default and must be cleared by a software instruction. when an xirq interrupt is recognized, the x- and i-bits are set after the registers are stacked, but before the interrupt vector is fetched. after the interrupt has been serviced, an rti instruction is normally executed, causing the registers to be restored to the values that were present before the interrupt occurred. the x interrupt mask bit is set only by hardware reset or xirq acknowledge). x is cleared only by program instruction (tap, where the associated bit of a is 0; or rti, where bit 6 of the value loaded into the ccr from the stack has been cleared). there is no hardware action for clearing x. 3.1.6.8 stop disable (s) setting the stop disable (s) bit prevents the stop instruction from putting the m68hc11 into a low-power stop condition. if the stop instruction is encountered by the cpu while the s-bit is set, it is treated as a no-operation (nop) instruction, and processing continues to the next instruction. s is set by reset ?stop disabled by default. 3.2 data types the m68hc11 cpu supports the following data types: bit data 8-bit and 16-bit signed and unsigned integers 16-bit unsigned fractions 16-bit addresses a byte is eight bits wide and can be accessed at any byte location. a word is composed of two consecutive bytes with the most signi?ant byte at the lower value address. because the m68hc11 is an 8-bit cpu, there are no special requirements for alignment of instructions or operands. tpg 46
mc68hc11pa8 motorola 3-7 cpu core and instruction set 3 3.3 opcodes and operands the m68hc11 family of microcontrollers uses 8-bit opcodes. each opcode identi?s a particular instruction and associated addressing mode to the cpu. several opcodes are required to provide each instruction with a range of addressing capabilities. only 256 opcodes would be available if the range of values were restricted to the number able to be expressed in 8-bit binary numbers. a four-page opcode map has been implemented to expand the number of instructions. an additional byte, called a prebyte, directs the processor from page 0 of the opcode map to one of the other three pages. as its name implies, the additional byte precedes the opcode. a complete instruction consists of a prebyte, if any, an opcode, and zero, one, two, or three operands. the operands contain information the cpu needs for executing the instruction. complete instructions can be from one to ?e bytes long. 3.4 addressing modes six addressing modes; immediate, direct, extended, indexed, inherent, and relative, detailed in the following paragraphs, can be used to access memory. all modes except inherent mode use an effective address. the effective address is the memory address from which the argument is fetched or stored, or the address from which execution is to proceed. the effective address can be speci?d within an instruction, or it can be calculated. 3.5 immediate (imm) in the immediate addressing mode an argument is contained in the byte(s) immediately following the opcode. the number of bytes following the opcode matches the size of the register or memory location being operated on. there are two, three, and four (if prebyte is required) byte immediate instructions. the effective address is the address of the byte following the instruction. 3.5.1 direct (dir) in the direct addressing mode, the low-order byte of the operand address is contained in a single byte following the opcode, and the high-order byte of the address is assumed to be $00. addresses $00?ff are thus accessed directly, using two-byte instructions. execution time is reduced by eliminating the additional memory access required for the high-order address byte. in most applications, this 256-byte area is reserved for frequently referenced data. in m68hc11 mcus, the memory map can be con?ured for combinations of internal registers, ram, or external memory to occupy these addresses. tpg 47
motorola 3-8 mc68hc11pa8 cpu core and instruction set 3 3.5.2 extended (ext) in the extended addressing mode, the effective address of the argument is contained in two bytes following the opcode byte. these are three-byte instructions (or four-byte instructions if a prebyte is required). one or two bytes are needed for the opcode and two for the effective address. 3.5.3 indexed (ind, x; ind, y) in the indexed addressing mode, an 8-bit unsigned offset contained in the instruction is added to the value contained in an index register (ix or iy) ?the sum is the effective address. this addressing mode allows referencing any memory location in the 64kbyte address space. these are two- to ?e-byte instructions, depending on whether or not a prebyte is required. 3.5.4 inherent (inh) in the inherent addressing mode, all the information necessary to execute the instruction is contained in the opcode. operations that use only the index registers or accumulators, as well as control instructions with no arguments, are included in this addressing mode. these are one or two-byte instructions. 3.5.5 relative (rel) the relative addressing mode is used only for branch instructions. if the branch condition is true, an 8-bit signed offset included in the instruction is added to the contents of the program counter to form the effective branch address. otherwise, control proceeds to the next instruction. these are usually two-byte instructions. 3.6 instruction set refer to table 3-2, which shows all the m68hc11 instructions in all possible addressing modes. for each instruction, the table shows the operand construction, the number of machine code bytes, and execution time in cpu e clock cycles. tpg 48
mc68hc11pa8 motorola 3-9 cpu core and instruction set 3 table 3-2 instruction set (page 1 of 6) mnemonic operation description addressing mode instruction condition codes opcode operand cycles s x h i n z v c aba add accumulators a + b t a inh 1b 2 d dddd abx add b to x ix + (00:b) t ix inh 3a 3 aby add b to y iy + (00:b) t iy inh 18 3a 4 adca (opr) add with carry to a a + m + c t a a imm a dir a ext a ind, x a ind, y 89 99 b9 a9 18 a9 ii dd hh ll ff ff 2 3 4 4 5 d dddd adcb (opr) add with carry to b b + m + c t b b imm b dir b ext b ind, x b ind, y c9 d9 f9 e9 18 e9 ii dd hh ll ff ff 2 3 4 4 5 d dddd adda (opr) add memory to a a + m t a a imm a dir a ext a ind, x a ind, y 8b 9b bb ab 18 ab ii dd hh ll ff ff 2 3 4 4 5 d dddd addb (opr) add memory to b b + m t b b imm b dir b ext b ind, x b ind, y cb db fb eb 18 eb ii dd hh ll ff ff 2 3 4 4 5 d dddd addd (opr) add 16-bit to d d + (m:m+1) t d imm dir ext ind, x ind, y c3 d3 f3 e3 18 e3 jj kk dd hh ll ff ff 4 5 6 6 7 dddd anda (opr) and a with memory a ?m t a a imm a dir a ext a ind, x a ind, y 84 94 b4 a4 18 a4 ii dd hh ll ff ff 2 3 4 4 5 dd 0 andb (opr) and b with memory b ?m t b b imm b dir b ext b ind, x b ind, y c4 d4 f4 e4 18 e4 ii dd hh ll ff ff 2 3 4 4 5 dd 0 asl (opr) arithmetic shift left ext ind, x ind, y 78 68 18 68 hh ll ff ff 6 6 7 dddd asla arithmetic shift left a a inh 48 2 dddd aslb arithmetic shift left b b inh 58 2 dddd asld arithmetic shift left d inh 05 3 dddd asr arithmetic shift right ext ind, x ind, y 77 67 18 67 hh ll ff ff 6 6 7 dddd asra arithmetic shift right a a inh 47 2 dddd asrb arithmetic shift right b b inh 57 2 dddd bcc (rel) branch if carry clear c = 0 ? rel 24 rr 3 bclr (opr) (msk) clear bit(s) m ?(mm ) t m dir ind, x ind, y 15 1d 18 1d dd mm ff mm ff mm 6 7 8 dd 0 bcs (rel) branch if carry set c = 1 ? rel 25 rr 3 beq (rel) branch if equal to zero z = 1 ? rel 27 rr 3 bge (rel) branch if 3 zero n ? v = 0 ? rel 2c rr 3 bgt (rel) branch if > zero z + (n ? v) = 0 ? rel 2e rr 3 bhi (rel) branch if higher c + z = 0 ? rel 22 rr 3 b7 b0 c 0 b15 b0 c 0 b7 b0 c tpg 49
motorola 3-10 mc68hc11pa8 cpu core and instruction set 3 bhs (rel) branch if higher or same c = 0 ? rel 24 rr 3 bita (opr) bit(s) test a with memory a ?m a imm a dir a ext a ind, x a ind, y 85 95 b5 a5 18 a5 ii dd hh ll ff ff 2 3 4 4 5 dd 0 bitb (opr) bit(s) test b with memory b ?m b imm b dir b ext b ind, x b ind, y c5 d5 f5 e5 18 e5 ii dd hh ll ff ff 2 3 4 4 5 dd 0 ble (rel) branch if zero z + (n ? v) = 1 ? rel 2f rr 3 blo (rel) branch if lower c = 1 ? rel 25 rr 3 bls (rel) branch if lower or same c + z = 1 ? rel 23 rr 3 blt (rel) branch if < zero n ? v = 1 ? rel 2d rr 3 bmi (rel) branch if minus n = 1 ? rel 2b rr 3 bne (rel) branch if 1 zero z = 0 ? rel 26 rr 3 bpl(rel) branch if plus n = 0 ? rel 2a rr 3 bra (rel) branch always 1 = 1 ? rel 20 rr 3 brclr(opr) (msk) (rel) branch if bit(s) clear m ?mm = 0 ? dir ind, x ind, y 13 1f 18 1f dd mm rr ff mm rr ff mm rr 6 7 8 brn (rel) branch never 1 = 0 ? rel 21 rr 3 brset(opr) (msk) (rel) branch if bit(s) set m ?mm = 0 ? dir ind, x ind, y 12 1e 18 1e dd mm rr ff mm rr ff mm rr 6 7 8 bset (opr) (msk) set bit(s) m + mm t m dir ind, x ind, y 14 1c 18 1c dd mm ff mm ff mm 6 7 8 dd 0 bsr (rel) branch to subroutine see figure 3-2 rel 8d rr 6 bvc (rel) branch if over?w clear v = 0 ? rel 28 rr 3 bvs (rel) branch if over?w set v = 1 ? rel 29 rr 3 cba compare a with b a ?b inh 11 2 dddd clc clear carry bit 0 t c inh 0c 2 0 cli clear interrupt mask 0 t i inh 0e 2 0 clr (opr) clear memory byte 0 t m dir ind, x ind, y 7f 6f 18 6f hh ll ff ff 6 6 7 0100 clra clear accumulator a 0 t a a inh 4f 2 0100 clrb clear accumulator b 0 t b b inh 5f 2 0100 clv clear over?w ?g 0 t v inh 0a 2 0 cmpa (opr) compare a with memory a ?m a imm a dir a ext a ind, x a ind, y 81 91 b1 a1 18 a1 ii dd hh ll ff ff 2 3 4 4 5 dddd cmpb (opr) compare b with memory b ?m b imm b dir b ext b ind, x b ind, y c1 d1 f1 e1 18 e1 ii dd hh ll ff ff 2 3 4 4 5 dddd com (opr) ones complement memory byte $ff ?m t m ext ind, x ind, y 73 63 18 63 hh ll ff ff 6 6 7 dd 01 coma ones complement a $ff ?a t a a inh 43 2 dd 01 comb ones complement b $ff ?b t b b inh 53 2 dd 01 table 3-2 instruction set (page 2 of 6) mnemonic operation description addressing mode instruction condition codes opcode operand cycles s x h i n z v c tpg 50
mc68hc11pa8 motorola 3-11 cpu core and instruction set 3 cpd (opr) compare d with memory (16-bit) d ?(m:m+1) imm dir ext ind, x ind, y 1a 83 1a 93 1a b3 1a a3 cd a3 jj kk dd hh ll ff ff 5 6 7 7 7 dddd cpx (opr) compare ix with memory (16-bit) ix ?(m:m+1) imm dir ext ind, x ind, y 8c 9c bc ac cd ac jj kk dd hh ll ff ff 4 5 6 6 7 dddd cpy (opr) compare iy with memory (16-bit) iy ?(m:m+1) imm dir ext ind, x ind, y 18 8c 18 9c 18 bc 1a ac 18 ac jj kk dd hh ll ff ff 5 6 7 7 7 dddd daa decimal adjust a adjust sum to bcd inh 19 2 dd ? d dec (opr) decrement memory byte m ?1 t m ext ind, x ind, y 7a 6a 18 6a hh ll ff ff 6 6 7 ddd deca decrement accumulator a a ?1 t a a inh 4a 2 ddd decb decrement accumulator b b ?1 t b b inh 5a 2 ddd des decrement stack pointer sp ?1 t sp inh 34 3 dex decrement index register x ix ?1 t ix inh 09 3 d dey decrement index register y iy ?1 t iy inh 18 09 4 d eora (opr) exclusive or a with memory a ? m t a a imm a dir a ext a ind, x a ind, y 88 98 b8 a8 18 a8 ii dd hh ll ff ff 2 3 4 4 5 dd 0 eorb (opr) exclusive or b with memory b ? m t a b imm b dir b ext b ind, x b ind, y c8 d8 f8 e8 18 e8 ii dd hh ll ff ff 2 3 4 4 5 dd 0 fdiv fractional divide, 16 by 16 d / ix t ix; r t d inh 03 41 ddd idiv integer divide, 16 by 16 d / ix t ix; r t d inh 02 41 d 0 d inc (opr) increment memory byte m + 1 t m ext ind, x ind, y 7c 6c 18 6c hh ll ff ff 6 6 7 ddd inca increment accumulator a a + 1 t a a inh 4c 2 ddd incb increment accumulator b b + 1 t b b inh 5c 2 ddd ins increment stack pointer sp + 1 t sp inh 31 3 inx increment index register x ix + 1 t ix inh 08 3 d iny increment index register y iy + 1 t iy inh 18 08 4 d jmp (opr) jump see figure 3-2 ext ind, x ind, y 7e 6e 18 6e hh ll ff ff 3 3 4 jsr (opr) jump to subroutine see figure 3-2 dir ext ind, x ind, y 9d bd ad 18 ad dd hh ll ff ff 5 6 6 7 ldaa (opr) load accumulator a m t a a imm a dir a ext a ind, x a ind, y 86 96 b6 a6 18 a6 ii dd hh ll ff ff 2 3 4 4 5 dd 0 table 3-2 instruction set (page 3 of 6) mnemonic operation description addressing mode instruction condition codes opcode operand cycles s x h i n z v c tpg 51
motorola 3-12 mc68hc11pa8 cpu core and instruction set 3 ldab (opr) load accumulator b m t b b imm b dir b ext b ind, x b ind, y c6 d6 f6 e6 18 e6 ii dd hh ll ff ff 2 3 4 4 5 dd 0 ldd (opr) load double accumulator d m t a; m+1 t b imm dir ext ind, x ind, y cc dc fc ec 18 ec jj kk dd hh ll ff ff 3 4 5 5 6 dd 0 lds (opr) load stack pointer m:m+1 t sp imm dir ext ind, x ind, y 8e 9e be ae 18 ae jj kk dd hh ll ff ff 3 4 5 5 6 dd 0 ldx (opr) load index register x m:m+1 t ix imm dir ext ind, x ind, y ce de fe ee cd ee jj kk dd hh ll ff ff 3 4 5 5 6 dd 0 ldy (opr) load index register y m:m+1 t iy imm dir ext ind, x ind, y 18 ce 18 de 18 fe 1a ee 18 ee jj kk dd hh ll ff ff 4 5 6 6 6 dd 0 lsl (opr) logical shift left ext ind, x ind, y 78 68 18 68 hh ll ff ff 6 6 7 dddd lsla logical shift left a a inh 48 2 dddd lslb logical shift left b b inh 58 2 dddd lsld logical shift left d inh 05 3 dddd lsr (opr) logical shift right ext ind, x ind, y 74 64 18 64 hh ll ff ff 6 6 7 0 ddd lsra logical shift right a a inh 44 2 0 ddd lsrb logical shift right b b inh 54 2 0 ddd lsrd logical shift right d inh 04 3 0 ddd mul multiply, 8 x 8 a * b t d inh 3d 10 d neg (opr) twos complement memory byte 0 ?m t m ext ind, x ind, y 70 60 18 60 hh ll ff ff 6 6 7 dddd nega twos complement a 0 ?a t a a inh 40 2 dddd negb twos complement b 0 ?b t b b inh 50 2 dddd nop no operation no operation inh 01 2 oraa or accumulator a (inclusive) a + m t a a imm a dir a ext a ind, x a ind, y 8a 9a ba aa 18 aa ii dd hh ll ff ff 2 3 4 4 5 dd 0 orab or accumulator b (inclusive) b + m t b b imm b dir b ext b ind, x b ind, y ca da fa ea 18 ea ii dd hh ll ff ff 2 3 4 4 5 dd 0 psha push a onto stack a t stack; sp = sp? a inh 36 3 pshb push b onto stack b t stack; sp = sp? b inh 37 3 pshx push ix onto stack (low ?st) ix t stack; sp = sp? inh 3c 4 pshy push iy onto stack (low ?st) iy t stack; sp = sp? inh 18 3c 5 table 3-2 instruction set (page 4 of 6) mnemonic operation description addressing mode instruction condition codes opcode operand cycles s x h i n z v c b7 b0 c 0 b15 b0 c 0 b7 b0 0 c b15 b0 0 c tpg 52
mc68hc11pa8 motorola 3-13 cpu core and instruction set 3 pula pull a from stack sp = sp+1; stack t a a inh 32 4 pulb pull b from stack sp = sp+1; stack t b b inh 33 4 pulx pull ix from stack (high ?st) sp = sp+2; stack t ix inh 38 5 puly pull iy from stack (high ?st) sp = sp+2; stack t iy inh 18 38 6 rol (opr) rotate left ext ind, x ind, y 79 69 18 69 hh ll ff ff 6 6 7 dddd rola rotate left a a inh 49 2 dddd rolb rotate left b b inh 59 2 dddd ror (opr) rotate right ext ind, x ind, y 76 66 18 66 hh ll ff ff 6 6 7 dddd rora rotate right a a inh 46 2 dddd rorb rotate right b b inh 56 2 dddd rti return from interrupt see figure 3-2 inh 3b 12 ddddddd rts return from subroutine see figure 3-2 inh 39 5 sba subtract b from a a ?b t a inh 10 2 dddd sbca (opr) subtract with carry from a a ?m ?c t a a imm a dir a ext a ind, x a ind, y 82 92 b2 a2 18 a2 ii dd hh ll ff ff 2 3 4 4 5 dddd sbcb (opr) subtract with carry from b b ?m ?c t b b imm b dir b ext b ind, x b ind, y c2 d2 f2 e2 18 e2 ii dd hh ll ff ff 2 3 4 4 5 dddd sec set carry 1 t c inh 0d 2 1 sei set interrupt mask 1 t i inh 0f 2 1 sev set over?w ?g 1 t v inh 0b 2 1 staa (opr) store accumulator a a t m a dir a ext a ind, x a ind, y 97 b7 a7 18 a7 dd hh ll ff ff 3 4 4 5 dd 0 stab (opr) store accumulator b b t m b dir b ext b ind, x b ind, y d7 f7 e7 18 e7 dd hh ll ff ff 3 4 4 5 dd 0 std (opr) store accumulator d a t m; b t m+1 dir ext ind, x ind, y dd fd ed 18 ed dd hh ll ff ff 4 5 5 6 dd 0 stop stop internal clocks inh cf 2 sts (opr) store stack pointer sp t m:m+1 dir ext ind, x ind, y 9f bf af 18 af dd hh ll ff ff 4 5 5 6 dd 0 stx (opr) store index register x ix t m:m+1 dir ext ind, x ind, y df ff ef cd ef dd hh ll ff ff 4 5 5 6 dd 0 sty (opr) store index register y iy t m:m+1 dir ext ind, x ind, y 18 df 18 ff 1a ef 18 ef dd hh ll ff ff 5 6 6 6 dd 0 table 3-2 instruction set (page 5 of 6) mnemonic operation description addressing mode instruction condition codes opcode operand cycles s x h i n z v c b7 b0 c b7 b0 c tpg 53
motorola 3-14 mc68hc11pa8 cpu core and instruction set 3 suba (opr) subtract memory from a a ?m t a a imm a dir a ext a ind, x a ind, y 80 90 b0 a0 18 a0 ii dd hh ll ff ff 2 3 4 4 5 dddd subb (opr) subtract memory from b b ?m t b b imm b dir b ext b ind, x b ind, y c0 d0 f0 e0 18 e0 ii dd hh ll ff ff 2 3 4 4 5 dddd subd (opr) subtract memory from d d ?m:m+1 t d imm dir ext ind, x ind, y 83 93 b3 a3 18 a3 jj kk dd hh ll ff ff 4 5 6 6 7 dddd swi software interrupt see figure 3-2 inh 3f 14 1 tab transfer a to b a t b inh 16 2 dd 0 tap transfer a to cc register a t ccr inh 06 2 ddddddd tba transfer b to a b t a inh 17 2 dd 0 test test (only in test modes) address bus increments inh 00 ? tpa transfer cc register to a ccr t a inh 07 2 tst (opr) test for zero or minus m ?0 ext ind, x ind, y 7d 6d 18 6d hh ll ff ff 6 6 7 dd 00 tsta test a for zero or minus a ?0 a inh 4d 2 dd 00 tstb test b for zero or minus b ?0 b inh 5d 2 dd 00 tsx transfer stack pointer to x sp + 1 t ix inh 30 3 tsy transfer stack pointer to y sp + 1 t iy inh 18 30 4 txs transfer x to stack pointer ix ?1 t sp inh 35 3 tys transfer y to stack pointer iy ?1 t sp inh 18 35 4 wai wait for interrupt stack registers & wait inh 3e xgdx exchange d with x ix t d; d t ix inh 8f 3 xgdy exchange d with y iy t d; d t iy inh 18 8f 4 operators operands t is transferred to dd 8-bit direct address ($0000?00ff); the high byte is assumed boolean and to be zero + arithmetic addition, except where used as an ff 8-bit positive offset ($00 to $ff (0 to 256)) is added to the inclusive-or symbol in boolean formulae contents of the index register ? exclusive-or hh high order byte of 16-bit extended address * multiply ii one byte of immediate data : concatenation jj high order byte of 16-bit immediate data arithmetic subtraction, or negation symbol kk low order byte of 16-bit immediate data (twos complement) ll low order byte of 16-bit extended address mm 8-bit mask (set bits to be affected) rr signed relative offset ($80 to $7f (?28 to +127)); offset is relative to the address following the offset byte cycles condition codes ? in?ite, or until reset occurs bit not changed 12 cycles are used, beginning with the opcode 0 bit always cleared fetch. a wait state is entered, which remains 1 bit always set in effect for an integer number of mpu e clock d bit set or cleared, depending on the operation cycles (n) until an interrupt is recognised. bit can be cleared, but cannot become set finally, two additional cycles are used to fetch ? not de?ed the appropriate interrupt vector. (14 + n, total). table 3-2 instruction set (page 6 of 6) mnemonic operation description addressing mode instruction condition codes opcode operand cycles s x h i n z v c tpg 54
mc68hc11pa8 motorola 4-1 operating modes and on-chip memory 4 4 operating modes and on-chip memory this section contains information about the modes that de?e mc68hc11pa8/mc68hc11pb8 operating conditions, and about the on-chip memory that allows the mcu to be con?ured for various applications. 4.1 operating modes the values of the mode select inputs modb and moda during reset determine the operating mode (see table 4-4). single chip and expanded modes are the normal modes. in single chip mode only on-board memory is available. expanded mode, however, allows access to external memory. each of these two normal modes is paired with a special mode. bootstrap, a variation of the single chip mode, is a special mode that executes a bootloader program in an internal bootstrap rom. test is a special mode that allows privileged access to internal resources. 4.1.1 single chip operating mode in single chip operating mode, the mc68hc11pa8/mc68hc11pb8 microcontroller has no external address or data bus. ports b, c, f, and the r/w pin are available for general purpose parallel i/o. 4.1.2 expanded operating mode in expanded operating mode, the mcu can access a 64k byte physical address space. the address space includes the same on-chip memory addresses used for single chip mode, in addition to external memory and peripheral devices. the expansion bus is made up of ports b, c, and f, and the r/w signal. in expanded mode, high order address bits are output on the port b pins, low order address bits on the port f pins, and the data bus on port c. the r/w /pg7 pin signals the direction of data transfer on the port c bus. tpg 55
motorola 4-2 mc68hc11pa8 operating modes and on-chip memory 4 to allow access to slow peripherals, off chip accesses can be extended by one e clock cycle, under control of the strch bit in the opt2 register. the e clock stretches externally, but the internal clocks are not affected so that timers and serial systems are not corrupted. see section 4.3.2.5. a security feature can protect eeprom data when in expanded mode; see section 4.4.4. 4.1.3 special test mode special test, a variation of the expanded mode, is used during motorolas internal production testing, and is not intended or recommended for any other purpose. its speci?ation is subject to change without notice. 4.1.4 special bootstrap mode when the mcu is reset in special bootstrap mode, a small on-chip rom is enabled at address $be40?bfff. the rom contains a reset vector and a bootloader program. the mcu fetches the reset vector, then executes the bootloader. for normal use of the bootloader program, send a synchronization byte $ff to the sci receiver at either e clock ? 256, or e clock ? 1664 (7812 or 1200 baud respectively, for an e clock of 2mhz). then download up to 2048 bytes of program data (which is put into ram starting at $0080). these characters are echoed through the transmitter. the bootloader program ends the download after a timeout of four character times or 2048 bytes. when loading is complete, the program jumps to location $0080 and begins executing the code. use of an external pull-up resistor is required when using the sci transmitter pin (txd) because port d pins are con?ured for wired-or operation by the bootloader. in bootstrap mode, the interrupt vectors point to ram. this allows the use of interrupts through a jump table. further baud rate options are available on the mc68hc11pa8/mc68hc11pb8 by using a different value for the synchronization byte, as shown in table 4-1. a special mode exists that allows a low frequency crystal to be used if the pll is active. in this case, the value on port f is loaded into the synr register just after reset, to be used as the multiplication factor for the crystal frequency. if the pll is not active, then the bootloader runs at the crystal frequency. refer to section 2.5 for more information on the operation of the pll circuitry. refer also to motorola application note an1060, m68hc11 bootstrap mode (the bootloader mode is similar to that used on the mc68hc11k4). tpg 56
mc68hc11pa8 motorola 4-3 operating modes and on-chip memory 4 table 4-1 example bootloader baud rates sync. byte timeout delay baud rates for an e clock of: 2.00mhz 2.10mhz 3.00mhz 3.15mhz 4.00mhz $ff 4 char. 7812 8192 11718 12288 15624 $ff 4 1200 1260 1800 1890 2400 $f0 4.9 9600 10080 14400 15120 19200 $fd 17.3 5208 5461 7812 8192 10416 $fd 13 3906 4096 5859 6144 7812 tpg 57
motorola 4-4 mc68hc11pa8 operating modes and on-chip memory 4 4.2 on-chip memory the mc68hc11pa8/mc68hc11pb8 mcu includes 2k bytes of on-chip ram, 48k bytes of rom/ eprom and 512 bytes of eeprom. the bootloader rom occupies a 512 byte block of the memory map. the config register is implemented as a separate eeprom byte. 4.2.1 mapping allocations memory locations for on-chip resources are the same for both expanded and single chip modes. the 128-byte register block originates at $0000 on reset and can be placed at any other 4k boundary ($x000) after reset by writing an appropriate value to the init register. refer to figure 4-1, which shows the memory map. the on-board 2k byte ram is initially located at $0080 after reset. the ram is divided into two sections, of 128 bytes and 1920 bytes. if ram and registers are both mapped to the same 4k boundary, ram starts at $x080 and 128 bytes are remapped at $x800?x87f. otherwise, ram starts at $x000. see figure 4-2. remapping is accomplished by writing appropriate values into the two nibbles of the init register. see section 4.3.2.2. figure 4-1 mc68hc11pa8/mc68hc11pb8/ MC68HC711PA8/mc68hc711pb8 memory map single chip expanded special bootstrap special test start address $0000 $0080 $0880 $0e00 $1000 $4000 $ffc0 ?ffff $be40 $c000 each of these blocks can be mapped to any 4k page boundary, using the init register. ? ? this block may be remapped to any 4k page, using init2. special bootstrap mode only. special modes only. 48k bytes rom (mc68hc11pa8/ can be mapped to either $0000?bfff or $4000?ffff, using the config register. normal mode vectors. vectors nvm 48k bytes vectors bootrom eeprom 512 bytes ram 2k bytes register block $x000 $x07f $x080 $x87f $xe00 $xfff $be40 $bfff $4000 $ffff $ffbf mc68hc711pb8) . 48k bytes eprom mc68hc11pb8) or (MC68HC711PA8/ tpg 58
mc68hc11pa8 motorola 4-5 operating modes and on-chip memory 4 the 512-byte eeprom is initially located at $0e00 after reset, when eeprom is enabled in the memory map by the config register. eeprom can be placed in any other 4k page ($xe00) by writing to the init2 register. the romad and romon bits in the config register control the position and presence of rom, or eprom , in the memory map. in special test mode, the romon bit is cleared so the rom/ eprom is removed from the memory map. in single chip mode, the romad bit is set to one after reset, which enables the rom/ eprom at $4000?ffff. in expanded mode, the rom/ eprom may be enabled from $0000?bfff (romad = 0) to allow an external memory to contain the interrupt vectors and initialization code. in special bootstrap mode, a bootloader rom is enabled at locations $be40?bfff. the vectors for special bootstrap mode are contained in the bootloader program. the boot rom occupies a 512 byte block of the memory map, though not all locations are used. 4.2.1.1 ram the mc68hc11pa8/mc68hc711pb8 has 2k bytes of fully static ram that are used for storing instructions, variables and temporary data during program execution. ram can be placed at any 4k boundary in the 64k byte address space by writing an appropriate value to the init register. by default, ram is initially located at $0080 in the memory map. direct addressing mode can access the ?st 128 locations of ram using a one-byte address operand. direct mode accesses save program memory space and execution time. registers can be moved to other boundaries to allow 256 bytes of ram to be located in direct addressing space. see figure 4-2. the on-chip ram is a fully static memory. ram contents can be preserved during periods of processor inactivity by either of two methods, both of which reduce power consumption: 1) during the software-based stop mode, mcu clocks are stopped, but the mcu continues to draw power from v dd . power supply current is directly related to operating frequency in cmos integrated circuits and there is very little leakage when the clocks are stopped. these two factors reduce power consumption while the mcu is in stop mode. 2) to reduce power consumption to a minimum, v dd can be turned off, and the modb/vstby pin can be used to supply ram power from either a battery back-up or a second power supply. although this method requires external hardware, it is very effective. refer to section 2 for information about how to connect the stand-by ram power supply and to section 5 for a description of low power operation. tpg 59
motorola 4-6 mc68hc11pa8 operating modes and on-chip memory 4 4.2.1.2 rom and eprom the mcu has 48k bytes of rom/ eprom . the rom/ eprom array is enabled when the romon bit in the config register is set to one (erased). the romad bit in config places the rom/ eprom at either $4000?ffff (romad = 1) or at $0000?bfff (romad = 0) when coming out of reset in expanded mode. 4.2.1.3 bootloader rom the bootloader rom is enabled at address $be40?bfff during special bootstrap mode. the reset vector is fetched from this rom and the mcu executes the bootloader ?mware. in normal modes, the bootloader rom is disabled. 4.2.2 registers in table 4-2, a summary of registers and control bits, the registers are shown in ascending order within the 128-byte register block. the addresses shown are for default block mapping ($0000?007f), however, the init register remaps the block to any 4k page ($x000?x07f). see section 4.3.2.2. tpg 60
mc68hc11pa8 motorola 4-7 operating modes and on-chip memory 4 table 4-2 register and control bit assignments (page 1 of 3) register name address bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 state on reset port a data (porta) $0000 pa7 pa6 pa5 pa4 pa3 pa2 pa1 pa0 unde?ed data direction a (ddra) $0001 dda7 dda6 dda5 dda4 dda3 dda2 dda1 dda0 0000 0000 data direction b (ddrb) $0002 ddb7 ddb6 ddb5 ddb4 ddb3 ddb2 ddb1 ddb0 0000 0000 data direction f (ddrf) $0003 ddf7 ddf6 ddf5 ddf4 ddf3 ddf2 ddf1 ddf0 0000 0000 port b data (portb) $0004 pb7 pb6 pb5 pb4 pb3 pb2 pb1 pb0 unde?ed port f data (portf) $0005 pf7 pf6 pf5 pf4 pf3 pf2 pf1 pf0 unde?ed port c data (portc) $0006 pc7 pc6 pc5 pc4 pc3 pc2 pc1 pc0 unde?ed data direction c (ddrc) $0007 ddc7 ddc6 ddc5 ddc4 ddc3 ddc2 ddc1 ddc0 0000 0000 port d data (portd) $0008 0 0 pd5 pd4 pd3 pd2 pd1 pd0 unde?ed data direction d (ddrd) $0009 0 0 ddd5 ddd4 ddd3 ddd2 ddd1 ddd0 0000 0000 port e data (porte) $000a pe7 pe6 pe5 pe4 pe3 pe2 pe1 pe0 unde?ed timer compare force (cforc) $000b foc1 foc2 foc3 foc4 foc5 0 0 0 0000 0000 output compare 1 mask (oc1m) $000c oc1m7 oc1m6 oc1m5 oc1m4 oc1m3 0 0 0 0000 0000 output compare 1 data (oc1d) $000d oc1d7 oc1d6 oc1d5 oc1d4 oc1d3 0 0 0 0000 0000 timer count (tcnt) high $000e (bit 15) (14) (13) (12) (11) (10) (9) (bit 8) 0000 0000 timer count (tcnt) low $000f (bit 7) (6) (5) (4) (3) (2) (1) (bit 0) 0000 0000 timer input capture 1 (tic1) high $0010 (bit 15) (14) (13) (12) (11) (10) (9) (bit 8) unde?ed timer input capture 1 (tic1) low $0011 (bit 7) (6) (5) (4) (3) (2) (1) (bit 0) unde?ed timer input capture 2 (tic2) high $0012 (bit 15) (14) (13) (12) (11) (10) (9) (bit 8) unde?ed timer input capture 2 (tic2) low $0013 (bit 7) (6) (5) (4) (3) (2) (1) (bit 0) unde?ed timer input capture 3 (tic3) high $0014 (bit 15) (14) (13) (12) (11) (10) (9) (bit 8) unde?ed timer input capture 3 (tic3) low $0015 (bit 7) (6) (5) (4) (3) (2) (1) (bit 0) unde?ed timer output compare 1 (toc1) high $0016 (bit 15) (14) (13) (12) (11) (10) (9) (bit 8) 1111 1111 timer output compare 1 (toc1) low $0017 (bit 7) (6) (5) (4) (3) (2) (1) (bit 0) 1111 1111 timer output compare 2 (toc2) high $0018 (bit 15) (14) (13) (12) (11) (10) (9) (bit 8) 1111 1111 timer output compare 2 (toc2) low $0019 (bit 7) (6) (5) (4) (3) (2) (1) (bit 0) 1111 1111 timer output compare 3 (toc3) high $001a (bit 15) (14) (13) (12) (11) (10) (9) (bit 8) 1111 1111 timer output compare 3 (toc3) low $001b (bit 7) (6) (5) (4) (3) (2) (1) (bit 0) 1111 1111 timer output compare 4 (toc4) high $001c (bit 15) (14) (13) (12) (11) (10) (9) (bit 8) 1111 1111 timer output compare 4 (toc4) low $001d (bit 7) (6) (5) (4) (3) (2) (1) (bit 0) 1111 1111 capture 4/compare 5 (ti4/o5) high $001e (bit 15) (14) (13) (12) (11) (10) (9) (bit 8) 1111 1111 capture 4/compare 5 (ti4/o5) low $001f (bit 7) (6) (5) (4) (3) (2) (1) (bit 0) 1111 1111 timer control 1 (tctl1) $0020 om2 ol2 om3 ol3 om4 ol4 om5 ol5 0000 0000 timer control 2 (tctl2) $0021 edg4b edg4a edg1b edg1a edg2b edg2a edg3b edg3a 0000 0000 timer interrupt mask 1 (tmsk1) $0022 oc1i oc2i oc3i oc4i i4/o5i ic1i ic2i ic3i 0000 0000 tpg 61
motorola 4-8 mc68hc11pa8 operating modes and on-chip memory 4 timer interrupt ?g 1 (tflg1) $0023 oc1f oc2f oc3f oc4f i4/o5f ic1f ic2f ic3f 0000 0000 timer interrupt mask 2 (tmsk2) $0024 toi rtii paovi paii 0 0 pr1 pr0 0000 0000 timer interrupt ?g 2 (tflg2) $0025 tof rtif paovf paif 0000 0000 0000 pulse accumulator control (pactl) $0026 0 paen pamod pedge 0 i4/o5 rtr1 rtr0 0000 0000 pulse accumulator count (pacnt) $0027 (bit 7) (6) (5) (4) (3) (2) (1) (bit 0) unde?ed spi control (spcr) $0028 spie spe dwom mstr cpol cpha spr1 spr0 0000 01uu spi status (spsr) $0029 spif wcol 0 modf 0 0 xpin ipin 0000 00uu spi data (spdr) $002a (bit 7) (6) (5) (4) (3) (2) (1) (bit 0) unde?ed eprom programming (eprog) $002b mbe 0 elat excol exrow 0 0 epgm 0000 0000 port pull-up assignment (ppar) $002c 00001 gppue fppue bppue 0000 1111 reserved $002d pll control (pllcr) $002e pllon bcs auto bwc vcot mcs 0 wen x011 1000 synthesizer program (synr) $002f synx1 synx0 syny5 syny4 syny3 syny2 syny1 syny0 mask option a/d control & status (adctl) $0030 ccf 0 scan mult cd cc cb ca u0uu uuuu a/d result 1 (adr1) $0031 (bit 7) (6) (5) (4) (3) (2) (1) (bit 0) unde?ed a/d result 2 (adr2) $0032 (bit 7) (6) (5) (4) (3) (2) (1) (bit 0) unde?ed a/d result 3 (adr3) $0033 (bit 7) (6) (5) (4) (3) (2) (1) (bit 0) unde?ed a/d result 4 (adr4) $0034 (bit 7) (6) (5) (4) (3) (2) (1) (bit 0) unde?ed block protect (bprot) $0035 bulkp 0 0 ptcon bprt3 bprt2 bprt1 bprt0 1001 1111 reserved $0036 eeprom mapping (init2) $0037 ee3 ee2 ee1 ee0 0000 0000 0000 system con?. options 2 (opt2) $0038 lirdv cwom strch irvne lsbf spr2 ext4x xirqe 000x 0000 system con?. options 1 (option) $0039 adpu csel irqe dly cme fcme cr1 cr0 0001 0000 cop timer arm/reset (coprst) $003a (bit 7) (6) (5) (4) (3) (2) (1) (bit 0) unde?ed eeprom programming (pprog) $003b odd even 0 byte row erase eelat eepgm 0000 0000 highest priority interrupt (hprio) $003c rboot smod mda psel4 psel3 psel2 psel1 psel0 xxx0 0110 ram & i/o mapping (init) $003d ram3 ram2 ram1 ram0 reg3 reg2 reg1 reg0 0000 0000 factory test (test1) $003e tilop pltst occr cbyp disr fcm fcop 0 0000 0000 con?uration control (config) $003f romad mbsp clk4x paren nosec nocop romon eeon xxxx xxxx i 2 c bus address (madr) $0040 madr7 madr6 madr5 madr4 madr3 madr2 madr1 0 0000 0000 i 2 c bus frequency divider (mfdr) $0041 0 0 0 mbc4 mbc3 mbc2 mbc1 mbc0 0000 0000 i 2 c bus control (mcr) $0042 men mien msta mtx txak 0 0 0 0000 0000 i 2 c bus status register (msr) $0043 mcf maas mbb mal 0 srw mif rxak 1000 0001 i 2 c bus data register (mdr) $0044 trxd7 trxd6 trxd5 trxd4 trxd3 trxd2 trxd1 trxd0 unde?ed reserved $0045 table 4-2 register and control bit assignments (page 2 of 3) register name address bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 state on reset tpg 62
mc68hc11pa8 motorola 4-9 operating modes and on-chip memory 4 reserved $0046 to reserved $006f sci baud rate high (scbdh) $0070 btst bspl brst sbr12 sbr11 sbr10 sbr9 sbr8 0000 0000 sci baud rate low (scbdl) $0071 sbr7 sbr6 sbr5 sbr4 sbr3 sbr2 sbr1 sbr0 0000 0100 sci control 1 (sccr1) $0072 loops woms 0 m wake ilt pe pt 0000 0000 sci control 2 (sccr2) $0073 tie tcie rie ilie te re rwu sbk 0000 0000 sci status 1 (scsr1) $0074 tdre tc rdrf idle or nf fe pf 1100 0000 sci status 2 (scsr2) $0075 0000000raf 0000 0000 sci data high (scdrh) $0076 r8 t8 000000 unde?ed sci data low (scdrl) $0077 r7t7 r6t6 r5t5 r4t4 r3t3 r2t2 r1t1 r0t0 unde?ed reserved $0078 reserved $0079 reserved $007a reserved $007b reserved $007c reserved $007d port g data (portg) $007e pg7 0000000 unde?ed data direction g (ddrg) $007f ddg7 0000000 0000 0000 table 4-2 register and control bit assignments (page 3 of 3) register name address bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 state on reset key applies only to eprom devices x state on reset depends on mode selected u state of bit on reset is unde?ed tpg 63
motorola 4-10 mc68hc11pa8 operating modes and on-chip memory 4 4.3 system initialization registers and bits that control initialization and the basic operation of the mcu are protected against writes except under special circumstances. the following table lists registers that can be written only once after reset, or that must be written within the ?st 64 cycles after reset. 4.3.1 mode selection the four mode variations are selected by the logic states of the mode a (moda) and mode b (modb) pins during reset. the moda and modb logic levels determine the logic state of the special mode (smod) and mode a (mda) control bits in the highest priority i-bit interrupt and miscellaneous (hprio) register. after reset is released, the mode select pins no longer in?ence the mcu operating mode. in single chip operating mode, moda pin is connected to a logic zero. in expanded mode, moda is normally connected to v dd through a pull-up resistor of 4.7 k w . the moda pin also functions as the load instruction register (lir ) pin when the mcu is not in reset. the open-drain active low lir output pin drives low during the ?st e cycle of each instruction. the modb pin also functions as the stand-by power input (vstby), which allows the ram contents to be maintained in the absence of v dd . (1) when smod = 0, bits 1 and 0 can be written only once, during the ?st 64 cycles, after which they become read-only. when smod = 1, however, these bits can be written at any time. all other bits can be written at any time. (2) bits can be written to zero once and only in the ?st 64 cycles or in special modes. bits can be set to one at any time. (3) bit 0 (xirqe) and bit 1 (ext4x) can be written only once; bit 4 (irvne) can be written only once in single chip and user expanded modes. (4) when smod = 0, bits 5, 4, 2, 1, and 0 can be written once and only in the ?st 64 cycles. when smod = 1, however, bits 5, 4, 2, 1, and 0 can be written at any time. all other bits can be written at any time. (5) when smod = 0, bits can be written only once, during the ?st 64 cycles, after which the register becomes read-only. when smod = 1, bits can be written at any time. table 4-3 registers with limited write access register address register name must be written in ?st 64 cycles write once only $x024 timer interrupt mask register 2 (tmsk2) (1) $x035 block protect register (bprot) (2) $x037 eeprom mapping register (init2) no yes $x038 system con?uration options register 2 (opt2) no (3) $x039 system con?uration options register (option) (4) $x03d ram and i/o map register (init) (5) tpg 64
mc68hc11pa8 motorola 4-11 operating modes and on-chip memory 4 refer to table 4-4, which is a summary of mode pin operation, the mode control bits and the four operating modes. a normal mode is selected when modb is logic one during reset. one of three reset vectors is fetched from address $fffa?ffff, and program execution begins from the address indicated by this vector. if modb is logic zero during reset, the special mode reset vector is fetched from addresses $bffa?bfff and software has access to special test features. refer to section 5. 4.3.1.1 hprio ?highest priority i-bit interrupt & misc. register note: rboot, smod and mda bits depend on the power-up initialization mode and can only be written in special modes when smod = 1. refer to table 4-4. rboot ?read bootstrap rom 1 (set) bootloader rom enabled, at $be40?bfff. 0 (clear) bootloader rom disabled and not in map. smod ?special mode select 1 (set) special mode variation in effect. 0 (clear) normal mode variation in effect. once cleared, cannot be set again. mda ?mode select a 1 (set) normal expanded or special test mode. (expanded buses active.) 0 (clear) normal single chip or special bootstrap mode. (ports active.) psel[4:0] ?priority select bits (refer to section 5) address bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 state on reset highest priority interrupt (hprio) $003c rboot smod mda psel4 psel3 psel2 psel1 psel0 xxx0 0110 table 4-4 hardware mode select summary inputs mode control bits in hprio (latched at reset) modb moda rboot smod mda 1 0 single chip 0 0 0 1 1 expanded 0 0 1 0 0 special bootstrap 1 1 0 0 1 special test 0 1 1 tpg 65
motorola 4-12 mc68hc11pa8 operating modes and on-chip memory 4 4.3.2 initialization because bits in the following registers control the basic con?uration of the mcu, an accidental change of their values could cause serious system problems. the protection mechanism, overridden in special operating modes, requires a write to the protected bits only within the ?st 64 bus cycles after any reset, or only once after each reset. see table 4-3. 4.3.2.1 config ?system con?uration register config controls the presence and/or location of rom/ eprom and eeprom in the memory map and enables the cop watchdog system. the mbsp bit con?ures the i 2 c bus and the paren bit enables pull-ups on certain ports. a security feature that protects data in eeprom and ram is available, controlled by the nosec bit. refer to section 4.4.4. config is made up of eeprom cells and static working latches. the operation of the mcu is controlled directly by these latches and not the eeprom byte. when programming the config register, the eeprom byte is accessed. when the config register is read, the static latches are accessed. these bits can be read at any time. the value read is the one latched into the register from the eeprom cells during the last reset sequence. a new value programmed into this register is not readable until after a subsequent reset sequence. bits in config can be written at any time if smod = 1 (bootstrap or special test mode). if smod = 0 (single chip or expanded mode), they can only be written using the eeprom programming sequence, and are neither readable nor active until latched via the next reset. romad ?rom mapping control 1 (set) rom/ eprom addressed from $4000 to $ffff. 0 (clear) rom/ eprom addressed from $0000 to $bfff (expanded mode only). in single chip mode, reset sets this bit. mbsp ?synchronous serial interface select 1 (set) spi is disabled. the i 2 c bus, if enabled, uses port d[4, 3] pins. 0 (clear) if enabled, the i 2 c bus uses port e[7, 6] pins. when mbsp is cleared, and the i 2 c bus is enabled, a/d channels are not available on port e[7, 6] pins. address bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 state on reset con?uration control (config) $003f romad mbsp clk4x paren nosec nocop romon eeon xxxx xxxx tpg 66
mc68hc11pa8 motorola 4-13 operating modes and on-chip memory 4 clk4x ?4x clock enable ? 1 (set) 4xclk or extali driven out on the xout pin (see section 4.3.2.5) 0 (clear) xout pin disabled. paren ?pull-up assignment register enable (refer to section 6) 1 (set) pull-ups can be enabled using ppar. 0 (clear) all pull-ups disabled (not controlled by ppar). nosec ?eeprom security disabled (refer to section 4.4.4) 1 (set) disable security. 0 (clear) enable security. nocop ?cop system disable (refer to section 5) 1 (set) cop system disabled. 0 (clear) cop system enabled (forces reset on timeout). romon ?rom enable 1 (set) rom/ eprom included in the memory map. 0 (clear) rom/ eprom excluded from the memory map. in single chip mode, reset sets this bit. in special test mode, reset clears romon. eeon ?eeprom enable 1 (set) eeprom included in the memory map. 0 (clear) eeprom is excluded from the memory map. ? the xout pin is not present on 64-pin qfp packaged devices. it is present on 68-pin clcc packaged versions of the MC68HC711PA8/mc68hc711pb8, which are available as samples only. contact your local motorola sales of?e for more information. tpg 67
motorola 4-14 mc68hc11pa8 operating modes and on-chip memory 4 4.3.2.2 init ?ram and i/o mapping register the internal registers used to control the operation of the mcu can be relocated on 4k boundaries within the memory space with the use of init. this 8-bit special-purpose register can change the default locations of the ram and control registers within the mcu memory map. it can be written to only once within the ?st 64 e clock cycles after a reset. it then becomes a read-only register. ram[3:0] ?ram map position these four bits, which specify the upper hexadecimal digit of the ram address, control the position of the ram in the memory map. the ram can be positioned at the beginning of any 4k page in the memory map. refer to table 4-5. reg[3:0] ?128-byte register block position these four bits specify the upper hexadecimal digit of the address for the 128-byte block of internal registers. the register block is positioned at the beginning of any 4k page in the memory map. refer to table 4-5. address bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 state on reset ram & i/o mapping (init) $003d ram3 ram2 ram1 ram0 reg3 reg2 reg1 reg0 0000 0000 table 4-5 ram and register remapping ram[3:0] location reg[3:0] location 0000 $0000?07ff 0000 $0000?007f 0001 $1000?17ff 0001 $1000?107f 0010 $2000?27ff 0010 $2000?207f 0011 $3000?37ff 0011 $3000?307f 0100 $4000?47ff 0100 $4000?407f 0101 $5000?57ff 0101 $5000?507f 0110 $6000?67ff 0110 $6000?607f 0111 $7000?77ff 0111 $7000?707f 1000 $8000?87ff 1000 $8000?807f 1001 $9000?97ff 1001 $9000?907f 1010 $a000?a7ff 1010 $a000?a07f 1011 $b000?b7ff 1011 $b000?b07f 1100 $c000?c7ff 1100 $c000?c07f 1101 $d000?d7ff 1101 $d000?d07f 1110 $e000?e7ff 1110 $e000?e07f 1111 $f000?f7ff 1111 $f000?f07f tpg 68
mc68hc11pa8 motorola 4-15 operating modes and on-chip memory 4 when the memory map has the 128-byte register block mapped at the same location as ram, the registers have priority and the ram is relocated to the memory space immediately following the register block. this mapping feature keeps all the ram available for use. refer to figure 4-2, which illustrates the overlap. 4.3.2.3 init2 ?eeprom mapping register this register determines the location of eeprom in the memory map. init2 may be read at any time but bits 7? may be written only once after reset in normal modes. ee[3:0] ?eeprom map position eeprom is located at $xe00?xfff, where x is the hexadecimal digit represented by ee[3:0]. refer to table 4-6. bits [3:0] ?not implemented; always read zero. figure 4-2 ram and register overlap address bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 state on reset eeprom mapping (init2) $0037 ee3 ee2 ee1 ee0 0000 0000 0000 $x000 $x07f $x080 $x7ff $x800 $x87f ram b ram a register block $x000 $x07f $x080 $x7ff ram b ram a register and ram mapped to different 4k boundaries. register and ram mapped to the same 4k boundary. tpg 69
motorola 4-16 mc68hc11pa8 operating modes and on-chip memory 4 4.3.2.4 option ?system con?uration options register 1 the 8-bit special-purpose option register sets internal system con?uration options during initialization. the time protected control bits irqe, dly, fcme and cr[1:0] can be written only once in the ?st 64 cycles after a reset and then they become read-only bits. this minimizes the possibility of any accidental changes to the system con?uration. they may be written at any time in special modes. adpu ?a/d power-up (refer to section 11) 1 (set) a/d system power enabled. 0 (clear) a/d system disabled, to reduce supply current. after enabling the a/d power, at least 100 m s should be allowed for system stabilization. csel ?clock select (refer to section 11) 1 (set) a/d, eprom and eeprom use internal rc clock source (about 1.5mhz). 0 (clear) a/d, eprom and eeprom use system e clock (must be at least 1mhz). this bit selects the clock source for the on-chip eprom , eeprom and a/d charge pumps. the on-chip rc clock should be used when the e clock frequency falls below 1mhz. irqe ?con?ure irq for falling-edge-sensitive operation 1 (set) falling-edge-sensitive operation. 0 (clear) low-level-sensitive operation. table 4-6 eeprom remapping ee[3:0] location ee[3:0] location 0000 $0e00?0fff 1000 $8e00?8fff 0001 $1e00?1fff 1001 $9e00?9fff 0010 $2e00?2fff 1010 $ae00?afff 0011 $3e00?3fff 1011 $be00?bfff 0100 $4e00?4fff 1100 $ce00?cfff 0101 $5e00?5fff 1101 $de00?dfff 0110 $6e00?6fff 1110 $ee00?efff 0111 $7e00?7fff 1111 $fe00?ffff address bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 state on reset system con?. options 1 (option) $0039 adpu csel irqe dly cme fcme cr1 cr0 0001 0000 tpg 70
mc68hc11pa8 motorola 4-17 operating modes and on-chip memory 4 dly ?enable oscillator start-up delay 1 (set) a stabilization delay is imposed as the mcu is started up from stop mode (or power-on reset). 0 (clear) the oscillator start-up delay is bypassed and the mcu resumes processing within about four bus cycles. a stable external oscillator is required if this option is selected. dly is set on reset, so a delay is always imposed as the mcu is started up from power-on reset. a mask option on the mc68hc11pa8/mc68hc11pb8 allows the selection of either a short or long delay time for power-on reset and exit from stop mode; either 128 or 4064 bus cycles. this option is not available on the MC68HC711PA8/mc68hc11pa8 on which the delay time is 4064 bus cycles. cme ?clock monitor enable (refer to section 5) 1 (set) clock monitor enabled. 0 (clear) clock monitor disabled. in order to use both stop and clock monitor, the cme bit should be cleared before executing stop, then set after recovering from stop. fcme ?force clock monitor enable (refer to section 5) 1 (set) clock monitor enabled; cannot be disabled until next reset. 0 (clear) clock monitor follows the state of the cme bit. when fcme is set, slow or stopped clocks will cause a clock failure reset sequence. to utilize stop mode, fcme should always be cleared. cr[1:0] ?cop timer rate select bits (refer to section 5) these control bits determine a scaling factor for the watchdog timer. tpg 71
motorola 4-18 mc68hc11pa8 operating modes and on-chip memory 4 4.3.2.5 opt2 ?system con?uration options register 2 lirdv ?lir driven 1 (set) enable lir drive high pulse. 0 (clear) lir not driven high on moda/lir pin. in single-chip and bootstrap modes, this bit has no meaning or effect. the lir pin is driven low to indicate that execution of an instruction has begun. the lir pin is normally con?ured for wired-or operation (only pulls low). in order to detect consecutive instructions in a high-speed application, this signal can be made to drive high for a quarter of a cycle to prevent false triggering (lirdv set). cwom ?port c wired-or mode (refer to section 6) 1 (set) port c outputs are open-drain. 0 (clear) port c operates normally. strch ?stretch external accesses 1 (set) off-chip accesses are extended by one e clock cycle. 0 (clear) normal operation. when this bit is set, off-chip accesses of addresses $0000 to $3fff (with romad = 1) or $c000 to $ffff (with romad = 0) are extended by one e clock cycle to allow access to slow peripherals. the e clock stretches externally, but the internal clocks are not affected, so that timers and serial systems are not corrupted. note: strch is cleared on reset; therefore a program cannot execute out of reset in a slow external rom. to use this feature, romon must be set on reset so that the device starts with internal rom included in the memory map. strch should then be set. strch has no effect in single chip and boot modes. address bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 state on reset system con?. options 2 (opt2) $0038 lirdv cwom strch irvne lsbf spr2 ext4x xirqe 000x 0000 tpg 72
mc68hc11pa8 motorola 4-19 operating modes and on-chip memory 4 irvne ?internal read visibility/not e irvne can be written once in any user mode. in expanded modes , irvne determines whether internal read visibility (irv) is on or off, but has no meaning in user expanded secure mode, as irv must be disabled. in special test modes, irvne is reset to one. in normal and bootstrap modes, irvne is reset to zero. 1 (set) data from internal reads is driven out of the external data bus. 0 (clear) no visibility of internal reads on external bus. in single chip modes this bit determines whether the e clock drives out from the chip. 1 (set) e pin is driven low. 0 (clear) e clock is driven out from the chip. refer to the following table for a summary of the operation immediately following reset. lsbf ?lsb-?st enable (refer to section 9) 1 (set) data is transferred lsb ?st. 0 (clear) data is transferred msb ?st. spr2 ?spi clock rate select (refer to section 9) this bit adds a divide-by-four to the spi clock chain. ext4x ?xout clock output select ? this bit can be written once and can be read at any time. 1 (set) extali clock is output on the xout pin. 0 (clear) 4xclk clock is output on the xout pin. this bit selects which clock is to be output on the xout pin, when enabled by the clk4x bit in config (see section 4.3.2.1). 4xclk can either be the output of the pll circuit, or the same as extali (see section 2.5). there is a phase delay between extali and xout. ? the xout pin is not present on 64-pin qfp packaged devices. it is present on 68-pin clcc packaged versions of the MC68HC711PA8/mc68hc711pb8, which are available as samples only. contact your local motorola sales of?e for more information. mode irvne after reset e clock after reset irv after reset irvne affects only irvne can be written single chip 0 on off e once expanded 0 on off irv once boot 0 on off e unlimited special test 1 on on irv unlimited tpg 73
motorola 4-20 mc68hc11pa8 operating modes and on-chip memory 4 xirqe ?con?ure xirq for falling edge sensitive operation this bit can be written once and can be read at any time. 1 (set) falling-edge-sensitive operation. 0 (clear) low-level-sensitive operation. 4.3.2.6 bprot ?block protect register bprot prevents accidental writes to eeprom and the config register. the bits in this register can be written to zero only once during the ?st 64 e clock cycles after reset in the normal modes; they can be set at any time. once the bits are cleared, the eeprom array and the config register can be programmed or erased. setting the bits in the bprot register to logic one protects the eeprom and config register until the next reset. refer to table 4-7. bulkp ?bulk erase of eeprom protect 1 (set) eeprom cannot be bulk or row erased. 0 (clear) eeprom can be bulk erased normally. bits [6, 5] ?not implemented; always read zero. ptcon ?protect for config register 1 (set) config register cannot be programmed or erased. 0 (clear) config register can be programmed or erased normally. note that, in special modes, config may be written regardless of the state of ptcon. bprt[3:0] ?block protect bits for eeprom 1 (set) protection is enabled for associated block; it cannot be programmed or erased. 0 (clear) protection disabled for associated block. each of these four bits protects a block of eeprom against writing or erasure, as follows: address bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 state on reset block protect (bprot) $0035 bulkp 0 0 ptcon bprt3 bprt2 bprt1 bprt0 1001 1111 table 4-7 eeprom block protect bit name block protected block size bprt0 $xe00?xe1f 32 bytes bprt1 $xe20?xe5f 64 bytes bprt2 $xe60?xedf 128 bytes bprt3 $xee0?xfff 288 bytes tpg 74
mc68hc11pa8 motorola 4-21 operating modes and on-chip memory 4 4.3.2.7 tmsk2 ?timer interrupt mask register 2 pr[1:0] are time-protected control bits and can be changed only once and then only within the ?st 64 bus cycles after reset in normal modes. note: bits in tmsk2 correspond bit for bit with ?g bits in tflg2. ones in tmsk2 enable the corresponding interrupt sources. toi ?timer over?w interrupt enable (refer to section 10) 1 (set) interrupt requested when tof is set. 0 (clear) tof interrupts disabled. rtii ?real-time interrupt enable (refer to section 10) 1 (set) interrupt requested when rtif set. 0 (clear) rtif interrupts disabled. paovi ?pulse accumulator over?w interrupt enable (refer to section 10) 1 (set) interrupt requested when paovf set. 0 (clear) paovf interrupts disabled. paii ?pulse accumulator interrupt enable (refer to section 10) 1 (set) interrupt requested when paif set. 0 (clear) paif interrupts disabled. bits [3, 2] ?not implemented; always read zero. pr[1:0] ?timer prescaler select these two bits select the prescale rate for the main 16-bit free-running timer system. these bits can be written only once during the ?st 64 e clock cycles after reset in normal modes, or at any time in special modes. refer to the following table: address bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 state on reset timer interrupt mask 2 (tmsk2) $0024 toi rtii paovi paii 0 0 pr1 pr0 0000 0000 pr[1:0] prescale factor 0 0 1 0 1 4 1 0 8 1 1 16 tpg 75
motorola 4-22 mc68hc11pa8 operating modes and on-chip memory 4 4.4 eprom , eeprom and config register 4.4.1 eprom using the on-chip eprom programming feature requires an external power supply (v ppe ). normal programming is accomplished using the eprog register. program eprom at room temperature only and place an opaque label over the quartz window during and after programming. the csel bit in the option register selects an on-chip oscillator clock for programming the eprom while operating at frequencies below 1mhz. the erased state of each eprom byte is $ff. 4.4.1.1 eprog ?eprom programming control register mbe ?multiple byte program enable 1 (set) program 12 bytes with the same data. 0 (clear) normal programming. eprom is made up of three blocks of 16k bytes. when programming, address bits 4 and 7 are ignored, so that 4 addresses per block are programmed simultaneously. address bits 14 and 15 are also ignored so that a total of twelve addresses are written at once, four in each 16k byte block. for example, with the eprom mapped to $4000?ffff, a write to $4026 will actually program $4026, $4036, $40a6, $40b6, $8026, $8036, $80a6, $80b6, $c026, $c036. $c0a6 and $c0b6 (i.e. %xx00 0000 x01x 0110). this bit may be read or written only in special modes; it will always read zero in normal modes. bits [6, 2, 1] ?not implemented; always read zero. elat ?eprom latch control 1 (set) eprom address and data buses con?ured for programming. eprom cannot be read. 0 (clear) eprom address and data buses con?ured for normal operation. when set, this bit causes the address and data for writes to the eprom to be latched. elat may be read and written at any time. address bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 state on reset eprom programming (eprog) $002b mbe 0 elat excol exrow 0 0 epgm 0000 0000 tpg 76
mc68hc11pa8 motorola 4-23 operating modes and on-chip memory 4 excol ?select extra columns 1 (set) user array disabled; extra column selected. 0 (clear) user array selected. the extra column may be accessed at bit 7; addresses use bits 15?, bits 4? must be ones. the excol bit always reads zero in normal modes and may be read or written only in special modes. exrow ?select extra rows 1 (set) user array disabled; extra rows selected. 0 (clear) user array selected. there are six extra rows (two in each block). addresses use bits 6?, bits 11? must be zeros. (the high nibble determines which 16k block is accessed.) the exrow bit always reads zero in normal modes and may be read or written only in special modes. epgm ?eprom program command 1 (set) programming voltage (v ppe ) switched to the eprom array. 0 (clear) programming voltage (v ppe ) disconnected from the eprom array. this bit can be read at any time, but may only be written if elat is set. note: if elat = 0 (normal operation) then epgm = 0 (programming voltage disconnected). 4.4.1.2 eprom programming the eprom may be programmed and veri?d in software, via the mcu, using the following procedure. the romon bit in the config register should be set. to use this method in special bootstrap mode, the external eprom programming voltage must be applied on pin vppe. on entry, a contains the data to be programmed and x contains the eprom address. eprog ldab #$20 stab $002b set elat bit (pgm=0) to enable eprom latches. staa $0, x store data to eprom address ldab #$21 stab $002b set epgm bit, with elat=1, to enable prog. voltage jsr dlyep delay teprog clr $002b turn off programming voltage and set to read mode user-developed software can be uploaded through the sci, or an eprom programming utility resident in the bootstrap rom can be used. to use the resident utility, bootload a three-byte program into ram consisting of a single jump instruction to $bf00 (the starting address of a resident eprom programming utility), along with instructions to set the x and y index registers to default values. the utility program receives programming data from an external host and puts it in tpg 77
motorola 4-24 mc68hc11pa8 operating modes and on-chip memory 4 eprom. the value in ix determines programming delay time; for example, at 4 mhz operation, a delay constant of 8000 in ix will give a 2ms delay time. the value in iy is a pointer to the ?st address in eprom to be programmed (normally = $4000). when the utility program is ready to receive programming data, it sends the host an $ff character; then it waits. when the host sees the $ff character, the eprom programming data is sent, starting with location $4000. after the last byte to be programmed is sent and the corresponding veri?ation data is returned, the programming operation is terminated by resetting the mcu. 4.4.2 eeprom the 512-byte on-board eeprom is initially located from $0e00 to $0fff after reset in all modes. it can be mapped to any other 4k page by writing to the init2 register. the eeprom is enabled by the eeon bit in the config register. programming and erasing are controlled by the pprog register. unlike information stored in rom, data in the 512 bytes of eeprom can be erased and reprogrammed under software control. because programming and erasing operations use an on-chip charge pump driven by v dd , a separate external power supply is not required. an internal charge pump supplies the programming voltage. use of the block protect register (bprot) prevents inadvertent writes to (or erases of) blocks of eeprom (see section 4.3.2.6). the csel bit in the option register selects an on-chip oscillator clock for programming and erasing the eeprom while operating at frequencies below 1mhz. in special modes there is one extra row of eeprom, which is used for factory testing. endurance and data retention speci?ations do not apply to these cells. the erased state of each eeprom byte is $ff. 4.4.2.1 pprog ?eeprom programming control register note: writes to eeprom addresses are inhibited while eepgm is one. a write to a different eeprom location is prevented while a program or erase operation is in progress. odd ?program odd rows in half of eeprom (test) even ?program even rows in half of eeprom (test) if both odd and even are set to one then all odd and even rows in half of the eeprom will be programmed with the same data, within one programming cycle. bit 5 ?not implemented; always reads zero. address bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 state on reset eeprom programming (pprog) $003b odd even 0 byte row erase eelat eepgm 0000 0000 tpg 78
mc68hc11pa8 motorola 4-25 operating modes and on-chip memory 4 byte ?eeprom byte erase mode 1 (set) erase only one byte of eeprom. 0 (clear) row or bulk erase mode used. this bit may be read or written at any time. row ?eeprom row/bulk erase mode (only valid when byte = 0) 1 (set) erase only one 16 byte row of eeprom. 0 (clear) erase all 512 bytes of eeprom. this byte can be read or written at any time. erase ?erase/normal control for eeprom 1 (set) erase mode. 0 (clear) normal read or program mode. this byte can be read or written at any time. eelat ?eeprom latch control 1 (set) eeprom address and data bus set up for programming or erasing. 0 (clear) eeprom address and data bus set up for normal reads. when the eelat bit is cleared, the eeprom can be read as if it were a rom. the block protect register has no effect during reads. this bit can be read and written at any time. eepgm ?eeprom program command 1 (set) program or erase voltage switched on to eeprom array. 0 (clear) program or erase voltage switched off to eeprom array. this bit can be read at any time but can only be written if eelat = 1. note: if eelat = 0 (normal operation) then eepgm = 0 (programming voltage disconnected). table 4-8 erase mode selection byte row action 0 0 bulk erase (all 512 bytes) 0 1 row erase (16 bytes) 1 0 byte erase 1 1 byte erase tpg 79
motorola 4-26 mc68hc11pa8 operating modes and on-chip memory 4 during eeprom programming, the row and byte bits of pprog are not used. if the frequency of the e clock is 1mhz or less, set the csel bit in the option register. remember that the eeprom must be erased by a separate erase operation before programming. the following example of how to program an eeprom byte assumes that the appropriate bits in bprot have been cleared. prog ldab #$02 eelat=1 stab $003b set eelat bit staa $0e00 store data to eeprom address ldab #$03 eelat=eepgm=1 stab $003b turn on programming voltage jsr dly10 delay teeprog clr $003b turn off high voltage and set to read mode 4.4.2.2 eeprom bulk erase to erase the eeprom, ensure that the appropriate bits in the bprot register are cleared, then complete the following steps using the pprog register: 1) write to pprog with the erase, eelat and appropriate byte and row bits set. 2) write to the appropriate eeprom address with any data. row erase only requires a write to any location in the row. bulk erase is accomplished by writing to any location in the array. 3) write to pprog with erase, eelat, eepgm and the appropriate byte and row bits set. 4) delay for time t eeprog . 5) clear the eepgm bit in pprog to turn off the high voltage. 6) clear the pprog register to recon?ure the eeprom address and data buses for normal operation. the following is an example of how to bulk erase the 512-byte eeprom. the config register is not affected in this example. bulke ldab #$06 eelat=erase=1 stab $003b set eelat bit staa $0e00 store data to any eeprom address ldab #$07 eelat=erase=eepgm=1 stab $003b turn on programming voltage jsr dly10 delay teeprog clr $003b turn off high voltage and set to read mode tpg 80
mc68hc11pa8 motorola 4-27 operating modes and on-chip memory 4 4.4.2.3 eeprom row erase the following example shows how to perform a fast erase of 16 bytes of eeprom: rowe ldab #$0e row=erase=eelat=1 stab $003b set to row erase mode stab 0,x write any data to any address in row ldab #$0f row=erase=eelat=eepgm=1 stab $003b turn on high voltage jsr dly10 delay teeprog clr $003b turn off high voltage and set to read mode 4.4.2.4 eeprom byte erase the following is an example of how to erase a single byte of eeprom: bytee ldab #$16 byte=erase=eelat=1 stab $003b set to byte erase mode stab 0,x write any data to address to be erased ldab #$17 byte=erase=eelat=eepgm=1 stab $003b turn on high voltage jsr dly10 delay teeprog clr $003b turn off high voltage and set to read mode 4.4.3 config register programming because the config register is implemented with eeprom cells, use eeprom procedures to erase and program this register. the procedure for programming is the same as for programming a byte in the eeprom array, except that the config register address is used. config can be programmed or erased (including byte erase) while the mcu is operating in any mode, provided that ptcon in bprot is clear. to change the value in the config register, complete the following procedure. do not initiate a reset until the procedure is complete. 1) erase the config register. 2) program the new value to the config address. 3) initiate reset. config ?system con?uration register for a description of the bits contained in the config register refer to section 4.3.2.1. address bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 state on reset con?uration control (config) $003f romad mbsp clk4x paren nosec nocop romon eeon xxxx xxxx tpg 81
motorola 4-28 mc68hc11pa8 operating modes and on-chip memory 4 config is made up of eeprom cells and static working latches. the operation of the mcu is controlled directly by these latches and not the eeprom byte. when programming the config register, the eeprom byte is accessed. when the config register is read, the static latches are accessed. these bits can be read at any time. the value read is the one latched into the register from the eeprom cells during the last reset sequence. a new value programmed into this register is not readable until after a subsequent reset sequence. bits in config can be written at any time if smod = 1 (bootstrap or special test mode). if smod = 0 (single chip or expanded mode), these bits can only be written using the eeprom programming sequence, and none of the bits is readable or active until latched via the next reset. 4.4.4 ram and eeprom security the optional security feature protects the contents of eeprom and ram from unauthorized access. data, codes, keys, a program, or a key portion of a program, can be protected against access. to accomplish this, the protection mechanism restricts operation of protected devices to single-chip modes, and thus prevents the memory locations from being monitored externally (single-chip modes do not allow visibility of the internal address and data buses).resident programs, however, have unlimited access to the internal eepromand ram and can read, write, or transfer the contents of these memories. note: a mask option on the mc68hc11pa8/mc68hc11pb8 determines whether or not the security feature is available (it is always available on the MC68HC711PA8/mc68hc711pb8). if the feature is available, then the secure mode can be invoked by programming the nosec bit to zero. otherwise, the nosec bit is permanently set to one, disabling security. if the security feature is present and enabled and bootstrap mode is selected, then the following sequence is performed by the bootstrap program: 1) output $ff on the sci. 2) turn block protect off. clear bprot register. 3) if eeprom is enabled, erase it all. 4) verify that the eeprom is erased; if not, begin sequence again. 5) write $ff to every ram byte. 6) erase the config register. if all the above operations are successful, the bootloading process continues as if the device has not been secured. tpg 82
mc68hc11pa8 motorola 4-29 operating modes and on-chip memory 4 config ?system con?uration register for a description of the other bits contained in the config register refer to section 4.3.2.1. nosec ?eeprom security disabled 1 (set) disable security. 0 (clear) enable security. with security enabled, selection of special test mode is prevented; single chip and user expanded modes may be accessed. if the moda and modb pins are con?ured for special test mode, the part will start in bootstrap mode. address bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 state on reset con?uration control (config) $003f romad mbsp clk4x paren nosec nocop romon eeon xxxx xxxx
motorola 4-30 mc68hc11pa8 operating modes and on-chip memory 4
mc68hc11pa8 motorola 5-1 resets and interrupts 5 5 resets and interrupts resets and interrupt operations load the program counter with a vector that points to a new location from which instructions are to be fetched. a reset immediately stops execution of the current instruction and forces the program counter to a known starting address. internal registers and control bits are initialized so that the mcu can resume executing instructions. an interrupt temporarily suspends normal program execution whilst an interrupt service routine is being executed. after an interrupt has been serviced, the main program resumes as if there had been no interruption. 5.1 resets there are four possible sources of reset. power-on reset (por) and external reset share the normal reset vector. the computer operating properly (cop) reset and the clock monitor reset each has its own vector. 5.1.1 power-on reset a positive transition on vdd generates a power-on reset (por), which is used only for power-up conditions. por cannot be used to detect drops in power supply voltages. a delay is imposed which allows the clock generator to stabilize after the oscillator becomes active. if reset is at logical zero at the end of the delay time, the cpu remains in the reset condition until reset goes to logical one. a mask option selects one of two delay times; either 128 or 4064 t cyc (internal clock cycles). note: this mask option is not available on the MC68HC711PA8/mc68hc711pb8, where the delay time is 4064 t cyc . it is important to protect the mcu during power transitions. most m68hc11 systems need an external circuit that holds the reset pin low whenever v dd is below the minimum operating level. this external voltage level detector, or other external reset circuits, are the usual source of reset in a system. the por circuit only initializes internal circuitry during cold starts. refer to figure 2-3. tpg 83
motorola 5-2 mc68hc11pa8 resets and interrupts 5 5.1.2 external reset (reset ) the cpu distinguishes between internal and external reset conditions by sensing whether the reset pin rises to a logic one in less than four e clock cycles after an internal device releases reset. when a reset condition is sensed, the reset pin is driven low by an internal device for eight e clock cycles, then released. four e clock cycles later it is sampled. if the pin is still held low, the cpu assumes that an external reset has occurred. if the pin is high, it indicates that the reset was initiated internally by either the cop system or the clock monitor. it is not advisable to connect an external resistor capacitor (rc) power-up delay circuit to the reset pin of m68hc11 devices because the circuit charge time constant can cause the device to misinterpret the type of reset that occurred. to guarantee recognition of an external reset, the reset pin should be held low for at least 16 clock cycles. 5.1.3 cop reset the mcu includes a cop system to help protect against software failures. when the cop is enabled, the software is responsible for keeping a free-running watchdog timer from timing out. when the software is no longer being executed in the intended sequence, a system reset is initiated. the state of the nocop bit in the config register determines whether the cop system is enabled or disabled. to change the enable status of the cop system, change the contents of the config register and then perform a system reset. in the special test and bootstrap operating modes, the cop system is initially inhibited by the disable resets (disr) control bit in the test1 register. the disr bit can subsequently be written to zero to enable cop resets. the cop system is clocked by st4xck/2 17 (see section 10). if the pll circuit is active (vddsyn = 1) and mcs and bcs are both set, then st4xck is equal to the output of the pll circuit, vcoout. otherwise, st4xck is the same as extali. refer to figure 10-1. the cop timer rate control bits, cr[1:0], in the option register determine the cop timeout period. st4xck/2 17 is scaled by the factor shown in table 5-1. after reset, bits cr[1:0] are zero, which selects the shortest timeout period. in normal operating modes, these bits can only be written once, within 64 bus cycles after reset. (1) the timeout period has a tolerance of ?/+one cycle of the st4xck/2 17 clock due to the asynchronous implementation of the cop circuitry. for example, with st4xck = 8mhz, the uncertainty is ?/+16.384ms. see also the m68hc11 reference manual, (m68hc11rm/ad) . table 5-1 cop timer rate select cr[1:0] divide st4xck/2 17 by st4xck = 4 mhz: timeout (1) st4xck = 8mhz: timeout (1) st4xck = 16mhz: timeout (1) 0 0 1 32.77 ms 16.384 ms 8.192 ms 0 1 4 131.07 ms 65.536 ms 32.768 ms 1 0 16 524.29 ms 262.14 ms 131.07 ms 1 1 64 2.097 ms 1.049 sec 524.29 ms tpg 84
mc68hc11pa8 motorola 5-3 resets and interrupts 5 5.1.3.1 coprst ?arm/reset cop timer circuitry register complete the following reset sequence to service the cop timer. write $55 to coprst to arm the cop timer clearing mechanism. then write $aa to coprst to clear the cop timer. executing instructions between these two steps is possible as long as both steps are completed in the correct sequence before the timer times out. 5.1.4 clock monitor reset the clock monitor circuit is based on an internal rc time delay. if no mcu clock edges are detected within this rc time delay, the clock monitor can optionally generate a system reset. the clock monitor function is enabled or disabled by the cme control bit in the option register. the presence of a timeout is determined by the rc delay, which allows the clock monitor to operate without any mcu clocks. clock monitor is used as a backup for the cop system. because the cop needs a clock to function, it is disabled when the clocks stop. therefore, the clock monitor system can detect clock failures not detected by the cop system. semiconductor wafer processing causes variations of the rc timeout values between individual devices. an e clock frequency below 10 khz is detected as a clock monitor error. an e clock frequency of 200 khz or more prevents clock monitor errors. use of the clock monitor function when the e clock is below 200 khz is not recommended. special considerations are needed when a stop instruction is executed and the clock monitor is enabled. because the stop function causes the clocks to be halted, the clock monitor function generates a reset sequence if it is enabled at the time the stop mode was initiated. before executing a stop instruction, clear the cme bit in the option register to zero to disable the clock monitor. after recovery from stop, set the cme bit to logic one to enable the clock monitor. address bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 state on reset cop timer arm/reset (coprst) $003a (bit 7) (6) (5) (4) (3) (2) (1) (bit 0) not affected tpg 85
motorola 5-4 mc68hc11pa8 resets and interrupts 5 5.1.5 option ?system con?uration options register 1 the special-purpose option register sets internal system con?uration options during initialization. the time protected control bits (irqe, dly, fcme and cr[1:0]) can be written to only once in the ?st 64 cycles after a reset and then they become read-only bits. this minimizes the possibility of any accidental changes to the system con?uration. they may be written at any time in special modes. adpu ?a/d power-up (refer to section 11) 1 (set) a/d system power enabled. 0 (clear) a/d system disabled, to reduce supply current. csel ?clock select (refer to section 11) 1 (set) a/d, eprom and eeprom use internal rc clock (about 1.5mhz). 0 (clear) a/d, eprom and eeprom use system e clock (must be at least 1mhz). irqe ?con?ure irq for falling-edge-sensitive operation (refer to section 4) 1 (set) falling-edge-sensitive operation. 0 (clear) low-level-sensitive operation. dly ?enable oscillator start-up delay (refer to section 4) 1 (set) a stabilization delay is imposed as the mcu is started up from stop mode (or from power-on reset). 0 (clear) the oscillator start-up delay is bypassed and the mcu resumes processing within about four bus cycles. a stable external oscillator is required if this option is selected. note: because dly is set on reset, a delay is always imposed as the mcu is started up from power-on reset. a mask option on the mc68hc11pa8/mc68hc11pb8 allows the selection of either a short or long delay time for power-on reset and exit from stop mode; either 128 or 4064 bus cycles. this option is not available on the MC68HC711PA8/mc68hc711pb8 where the delay time is 4064 bus cycles. address bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 state on reset system con?. options 1 (option) $0039 adpu csel irqe dly cme fcme cr1 cr0 0001 0000 tpg 86
mc68hc11pa8 motorola 5-5 resets and interrupts 5 cme ?clock monitor enable 1 (set) clock monitor enabled. 0 (clear) clock monitor disabled. this control bit can be read or written at any time and controls whether or not the internal clock monitor circuit triggers a reset sequence when the system clock is slow or absent. when it is clear, the clock monitor circuit is disabled, and when it is set, the clock monitor circuit is enabled. reset clears the cme bit. in order to use both stop and clock monitor, the cme bit should be cleared before executing stop, then set after recovering from stop. fcme ?force clock monitor enable 1 (set) clock monitor enabled; cannot be disabled until next reset. 0 (clear) clock monitor follows the state of the cme bit. when fcme is set, slow or stopped clocks will cause a clock failure reset sequence. to utilize stop mode, fcme should always be cleared. cr[1:0] ?cop timer rate select bits the cop function is clocked by st4xck/2 17 . st4xck can be either extali or vcoout (see section 5.1.3). these control bits determine a scaling factor for the watchdog timer period. see table 5-1. 5.1.6 config ?con?uration control register among other things, config controls the presence and location of eeprom in the memory map and enables the cop watchdog system. a security feature that protects data in eeprom and ram is available on mask programmed mcus. config is made up of eeprom cells and static working latches. the operation of the mcu is controlled directly by these latches and not the eeprom byte. when programming the config register, the eeprom byte is accessed. when the config register is read, the static latches are accessed. these bits can be read at any time. the value read is the one latched into the register from the eeprom cells during the last reset sequence. a new value programmed into this register is not readable until after a subsequent reset sequence. address bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 state on reset con?uration control (config) $003f romad mbsp clk4x paren nosec nocop romon eeon xxxx xxxx tpg 87
motorola 5-6 mc68hc11pa8 resets and interrupts 5 bits in config can be written at any time if smod = 1 (bootstrap or special test mode). if smod = 0 (single chip or expanded mode), they can only be written using the eeprom programming sequence, and are neither readable nor active until latched via the next reset. romad ?rom/ eprom mapping control (refer to section 4) 1 (set) rom addressed from $4000 to $ffff. 0 (clear) rom addressed from $0000 to $bfff (expanded mode only). in single chip mode, reset sets this bit. mbsp ?synchronous serial interface select (refer to section 4) 1 (set) if enabled, the i 2 c bus uses port d[4, 3] pins; spi is disabled. 0 (clear) if enabled, the i 2 c bus uses port e[7, 6] pins. clk4x ?4x clock enable ? (refer to section 4) 1 (set) 4xclk or extali driven out on the xout pin (see section 4.3.2.5) 0 (clear) xout pin disabled. paren ?pull-up assignment register enable (refer to section 6) 1 (set) ppar register enabled; pull-ups can be enabled using ppar. 0 (clear) ppar register disabled; all pull-ups disabled. nosec ?eeprom security disabled (refer to section 4) 1 (set) disable security. 0 (clear) enable security. nocop ?cop system disable 1 (set) cop system disabled. 0 (clear) cop system enabled (forces reset on timeout). romon ?rom/ eprom enable (refer to section 4) 1 (set) rom/ eprom included in the memory map. 0 (clear) rom/ eprom excluded from the memory map. ? the xout pin is not present on 64-pin qfp packaged devices. it is present on 68-pin clcc packaged versions of the MC68HC711PA8/mc68hc711pb8, which are available as samples only. contact your local motorola sales of?e for more information. tpg 88
mc68hc11pa8 motorola 5-7 resets and interrupts 5 eeon ?eeprom enable (refer to section 4) 1 (set) eeprom included in the memory map. 0 (clear) eeprom excluded from the memory map. 5.2 effects of reset when a reset condition is recognized, the internal registers and control bits are forced to an initial state. depending on the cause of the reset and the operating mode, the reset vector can be fetched from any of six possible locations, as shown in table 5-2. these initial states then control on-chip peripheral systems to force them to known start-up states, as described in the following paragraphs. 5.2.1 central processing unit after reset, the cpu fetches the restart vector from the appropriate address during the ?st three cycles, and begins executing instructions. the stack pointer and other cpu registers are indeterminate immediately after reset; however, the x and i interrupt mask bits in the condition code register (ccr) are set to mask any interrupt requests. also, the s-bit in the ccr is set to inhibit the stop mode. 5.2.2 memory map after reset, the init register is initialized to $00, putting the 2k bytes of ram at locations $0080?087f, and the control registers at locations $0000?007f. the init2 register puts eeprom at locations $0e00?0fff. table 5-2 reset cause, reset vector and operating mode cause of reset normal mode vector special test or bootstrap por or reset pin $fffe, $ffff $bffe, $bfff clock monitor failure $fffc, $fffd $bffc, $bffd cop watchdog timeout $fffa, $fffb $bffa, $bffb tpg 89
motorola 5-8 mc68hc11pa8 resets and interrupts 5 5.2.3 parallel i/o when a reset occurs in expanded operating modes, port b, c, and f pins and pg7 used for parallel i/o are dedicated to the expansion bus. if a reset occurs during a single chip operating mode, all ports are con?ured as general purpose high-impedance inputs. note: do not confuse pin function with the electrical state of the pin at reset. all general-purpose i/o pins con?ured as inputs at reset are in a high-impedance state. port data registers re?ct the ports functional state at reset. the pin function is mode dependent. 5.2.4 timer during reset, the timer system is initialized to a count of $0000. the prescaler bits are cleared, and all output compare registers are initialized to $ffff. all input capture registers are indeterminate after reset. the output compare 1 mask (oc1m) register is cleared so that successful oc1 compares do not affect any i/o pins. the other four output compares are con?ured so that they do not affect any i/o pins on successful compares. all input capture edge-detector circuits are con?ured for capture disabled operation. the timer over?w interrupt ?g and all eight timer function interrupt ?gs are cleared. all nine timer interrupts are disabled because their mask bits have been cleared. the i4/o5 bit in the pactl register is cleared to con?ure the i4/o5 function as oc5; however, the om5:ol5 control bits in the tctl1 register are clear so oc5 does not control the pa3 pin. 5.2.5 real-time interrupt (rti) the real-time interrupt ?g (rtif) is cleared and automatic hardware interrupts are masked. the rate control bits are cleared after reset and can be initialized by software before the real-time interrupt (rti) system is used. 5.2.6 pulse accumulator the pulse accumulator system is disabled at reset so that the pulse accumulator input (pai) pin defaults to being a general-purpose input pin. tpg 90
mc68hc11pa8 motorola 5-9 resets and interrupts 5 5.2.7 computer operating properly (cop) the cop watchdog system is enabled if the nocop control bit in the config register is cleared, and disabled if nocop is set. the cop rate is set for the shortest duration timeout. 5.2.8 serial communications interface (sci) the reset condition of the sci system is independent of the operating mode. at reset, the sci baud rate control register is initialized to $0004. all transmit and receive interrupts are masked and both the transmitter and receiver are disabled so the port pins default to being general purpose i/o lines. the sci frame format is initialized to an 8-bit character size. the send break and receiver wake-up functions are disabled. the tdre and tc status bits in the sci status register are both set, indicating that there is no transmit data in either the transmit data register or the transmit serial shift register. the rdrf, idle, or, nf, fe, pf, and raf receive-related status bits are cleared. 5.2.9 serial peripheral interface (spi) the spi system is disabled by reset. its associated port pins default to being general purpose i/o lines. 5.2.10 i 2 c bus the i 2 c bus is disabled on reset. 5.2.11 analog-to-digital converter the a/d converter con?uration is indeterminate after reset. the adpu bit is cleared by reset, which disables the a/d system. the conversion complete ?g is cleared by reset. 5.2.12 system the eeprom programming controls are disabled, so the memory system is con?ured for normal read operation. psel[4:0] are initialized with the binary value %00110, causing the external irq pin to have the highest i-bit interrupt priority. the irq and xirq pins are con?ured for level-sensitive operation (for wired-or systems). the rboot, smod, and mda bits in the hprio register re?ct the status of the modb and moda inputs at the rising edge of reset. the dly control bit is set to specify that an oscillator start-up delay is imposed upon recovery from stop mode or power-on reset. the clock monitor system is disabled because cme and fcme are cleared. tpg 91
motorola 5-10 mc68hc11pa8 resets and interrupts 5 5.3 reset and interrupt priority resets and interrupts have a hardware priority that determines which reset or interrupt is serviced ?st when simultaneous requests occur. any maskable interrupt can be given priority over other maskable interrupts. the ?st six interrupt sources are not maskable by the i-bit in the ccr. the priority arrangement for these sources is ?ed and is as follows: 1) por or reset pin 2) clock monitor reset 3) cop watchdog reset 4) xirq interrupt illegal opcode interrupt ?see section 5.4.3 for details of handling software interrupt (swi) ?see section 5.4.4 for details of handling the maskable interrupt sources have the following priority arrangement: 5) irq 6) real-time interrupt 7) timer input capture 1 8) timer input capture 2 9) timer input capture 3 10) timer output compare 1 11) timer output compare 2 12) timer output compare 3 13) timer output compare 4 14) timer input capture 4/output compare 5 15) i 2 c bus 16) timer over?w 17) pulse accumulator over?w 18) pulse accumulator input edge 19) spi transfer complete 20) sci system any one of these maskable interrupts can be assigned the highest maskable interrupt priority by writing the appropriate value to the psel bits in the hprio register. otherwise, the priority arrangement remains the same. an interrupt that is assigned highest priority is still subject to global masking by the i-bit in the ccr, or by any associated local bits. interrupt vectors are not affected by priority assignment. to avoid race conditions, hprio can only be written while i-bit interrupts are inhibited. tpg 92
mc68hc11pa8 motorola 5-11 resets and interrupts 5 5.3.1 hprio ?highest priority i-bit interrupt and misc. register rboot, smod, and mda bits depend on power-up initialization mode and can only be written in special modes when smod = 1. refer to table 4-4. rboot ?read bootstrap rom (refer to section 4) 1 (set) bootloader rom enabled, at $be40?bfff. 0 (clear) bootloader rom disabled and not in map. smod ?special mode select (refer to section 4) 1 (set) special mode variation in effect. 0 (clear) normal mode variation in effect. mda ?mode select a (refer to section 4) 1 (set) normal expanded or special test mode in effect. 0 (clear) normal single chip or special bootstrap mode in effect. psel[4:0] ?priority select bits these bits select one interrupt source to be elevated above all other i-bit-related sources and can be written to only while the i-bit in the ccr is set (interrupts disabled). see table 5-3. address bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 state on reset highest priority interrupt (hprio) $003c rboot smod mda psel4 psel3 psel2 psel1 psel0 xxx0 0110 tpg 93
motorola 5-12 mc68hc11pa8 resets and interrupts 5 table 5-3 highest priority interrupt selection pselx interrupt source promoted 43210 0 0 0 x x reserved (default to irq ) 00100 reserved (default to irq ) 00101 reserved (default to irq ) 00110irq (external pin) 00111 real-time interrupt 01000 timer input capture 1 01001 timer input capture 2 01010 timer input capture 3 01011 timer output compare 1 01100 timer output compare 2 01101 timer output compare 3 01110 timer output compare 4 01111 timer output compare 5/input capture 4 10000 timer over?w 10001 pulse accumulator over?w 10010 pulse accumulator input edge 10011 spi serial transfer complete 10100 sci serial system 10101i 2 c serial system 1011x reserved (default to irq ) 1 1 x x x reserved (default to irq ) tpg 94
mc68hc11pa8 motorola 5-13 resets and interrupts 5 table 5-4 interrupt and reset vector assignments vector address interrupt source ccr mask bit local mask ffc0, c1 ?ffd2, d3 ?reserved ffd4, d5 ?i 2 c bus i mien ffd6, d7 ?sci receive data register full ?sci receiver overrun ?sci transmit data register empty ?sci transmit complete ?sci idle line detect i rie rie tie tcie ilie ffd8, d9 spi serial transfer complete i spie ffda, db pulse accumulator input edge i paii ffdc, dd pulse accumulator over?w i paovi ffde, df timer over?w i toi ffe0, e1 timer input capture 4/output compare 5 i i4/o5i ffe2, e3 timer output compare 4 i oc4i ffe4, e5 timer output compare 3 i oc3i ffe6, e7 timer output compare 2 i oc2i ffe8, e9 timer output compare 1 i oc1i ffea, eb timer input capture 3 i ic3i ffec, ed timer input capture 2 i ic2i ffee, ef timer input capture 1 i ic1i fff0, f1 real-time interrupt i rtii fff2, f3 irq pin i none fff4, f5 xirq pin x none fff6, f7 software interrupt none none fff8, f9 illegal opcode trap none none fffa, fb cop failure none nocop fffc, fd clock monitor fail none cme fffe, ff reset none none tpg 95
motorola 5-14 mc68hc11pa8 resets and interrupts 5 5.4 interrupts excluding reset type interrupts, the mc68hc11pa8/mc68hc11pb8 has 19 interrupt vectors that support 23 interrupt sources. the 16 maskable interrupts are generated by on-chip peripheral systems. these interrupts are recognized when the global interrupt mask bit (i) in the condition code register (ccr) is clear. the three nonmaskable interrupt sources are illegal opcode trap, software interrupt, and xirq pin. refer to table 5-4, which shows the interrupt sources and vector assignments for each source. for some interrupt sources, such as the sci interrupts, the ?gs are automatically cleared during the normal course of responding to the interrupt requests. for example, the rdrf ?g in the sci system is cleared by the automatic clearing mechanism consisting of a read of the sci status register while rdrf is set, followed by a read of the sci data register. the normal response to an rdrf interrupt request would be to read the sci status register to check for receive errors, then to read the received data from the sci data register. these two steps satisfy the automatic clearing mechanism without requiring any special instructions. 5.4.1 interrupt recognition and register stacking an interrupt can be recognized at any time after it is enabled by its local mask, if any, and by the global mask bit in the ccr. once an interrupt source is recognized, the cpu responds at the completion of the instruction being executed. interrupt latency varies according to the number of cycles required to complete the current instruction. when the cpu begins to service an interrupt, the contents of the cpu registers are pushed onto the stack in the order shown in table 5-5. after the ccr value is stacked, the i-bit and the x-bit, if xirq is pending, are set to inhibit further interrupts. the interrupt vector for the highest priority pending source is fetched, and execution continues at the address speci?d by the vector. at the end of the interrupt service routine, the return from interrupt instruction is executed and the saved registers are pulled from the stack in reverse order so that normal program execution can resume. refer to section 3 for further information. table 5-5 stacking order on entry to interrupts memory location cpu registers sp pcl sp ?1 pch sp ?2 iyl sp ?3 iyh sp ?4 ixl sp ?5 ixh sp ?6 acca sp ?7 accb sp ?8 ccr tpg 96
mc68hc11pa8 motorola 5-15 resets and interrupts 5 5.4.2 nonmaskable interrupt request (xirq ) nonmaskable interrupts are useful because they can always interrupt cpu operations. the most common use for such an interrupt is for serious system problems, such as program runaway or power failure. the xirq input is an updated version of the nmi (nonmaskable interrupt) input of earlier mcus. upon reset, both the x-bit and i-bit of the ccr are set to inhibit all maskable interrupts and xirq . after minimum system initialization, software can clear the x-bit by a tap instruction, enabling xirq interrupts. thereafter, software cannot set the x-bit. thus, an xirq interrupt is a nonmaskable interrupt. because the operation of the i-bit-related interrupt structure has no effect on the x-bit, the internal xirq pin remains unmasked. in the interrupt priority logic, the xirq interrupt has a higher priority than any source that is maskable by the i-bit. all i-bit-related interrupts operate normally with their own priority relationship. when an i-bit-related interrupt occurs, the i-bit is automatically set by hardware after stacking the ccr byte. the x-bit is not affected. when an x-bit-related interrupt occurs, both the x and i bits are automatically set by hardware after stacking the ccr. a return from interrupt instruction restores the x and i bits to their pre-interrupt request state. 5.4.3 illegal opcode trap because not all possible opcodes or opcode sequences are de?ed, the mcu includes an illegal opcode detection circuit, which generates an interrupt request. when an illegal opcode is detected and the interrupt is recognized, the current value of the program counter is stacked. after interrupt service is complete, the user should reinitialize the stack pointer to ensure that repeated execution of illegal opcodes does not cause stack under?w. left uninitialized, the illegal opcode vector can point to a memory location that contains an illegal opcode. this condition causes an in?ite loop that causes stack under?w. the stack grows until the system crashes. the illegal opcode trap mechanism works for all unimplemented opcodes on all four opcode map pages. the address stacked as the return address for the illegal opcode interrupt is the address of the ?st byte of the illegal opcode. otherwise, it would be almost impossible to determine whether the illegal opcode had been one or two bytes. the stacked return address can be used as a pointer to the illegal opcode, so that the illegal opcode service routine can evaluate the offending opcode. 5.4.4 software interrupt swi is an instruction, and thus cannot be interrupted until complete. swi is not inhibited by the global mask bits in the ccr. because execution of swi sets the i mask bit, once an swi interrupt begins, other interrupts are inhibited until swi is complete, or until user software clears the i bit in the ccr. tpg 97
motorola 5-16 mc68hc11pa8 resets and interrupts 5 5.4.5 maskable interrupts the maskable interrupt structure of the mcu can be extended to include additional external interrupt sources through the irq pin. the default con?uration of this pin is a low-level sensitive wired-or network. when an event triggers an interrupt, a software accessible interrupt ?g is set. when enabled, this ?g causes a constant request for interrupt service. after the ?g is cleared, the service request is released. 5.4.6 reset and interrupt processing the following ?w diagrams illustrate the reset and interrupt process. figure 5-1 and figure 5-2 illustrate how the cpu begins from a reset and how interrupt detection relates to normal opcode fetches. figure 5-3 to figure 5-4 provide an expanded version of a block in figure 5-1 and illustrate interrupt priorities. figure 5-6 shows the resolution of interrupt sources within the sci subsystem. 5.5 low power operation both stop and wait suspend cpu operation until a reset or interrupt occurs. the wait condition suspends processing and reduces power consumption to an intermediate level. the stop condition turns off all on-chip clocks and reduces power consumption to an absolute minimum while retaining the contents of all bytes of the ram. 5.5.1 wait the wai opcode places the mcu in the wait condition, during which the cpu registers are stacked and cpu processing is suspended until a quali?d interrupt is detected. the interrupt can be an external irq , an xirq , or any of the internally generated interrupts, such as the timer or serial interrupts. the on-chip crystal oscillator remains active throughout the wait stand-by period. the reduction of power in the wait condition depends on how many internal clock signals driving on-chip peripheral functions can be shut down. the cpu is always shut down during wait. while in the wait state, the address/data bus repeatedly runs read cycles to the address where the ccr contents were stacked. the mcu leaves the wait state when it senses any interrupt that has not been masked. the ph2 clock to the free-running timer system is stopped if the i-bit is set and the cop system is disabled by nocop being set. several other systems can also be in a reduced power consumption state depending on the state of software-controlled con?uration control bits. power consumption by the analog-to-digital (a/d) converter is not affected signi?antly by the wait condition. however, the a/d converter current can be eliminated by writing the adpu bit to zero and halting the rc clock (csel cleared). the spi system is enabled or disabled by the spe tpg 98
mc68hc11pa8 motorola 5-17 resets and interrupts 5 control bit, and the i 2 c bus is disabled by the men bit. the sci transmitter is enabled or disabled by the te bit, and the sci receiver is enabled or disabled by the re bit (lowest power consumption is achieved when re=te=0). setting the wen bit in pllcr will result in wait mode using a slower clock and hence less power (see section 2.5). therefore the power consumption in wait is dependent on the particular application. 5.5.2 stop executing the stop instruction while the s-bit in the ccr is clear places the mcu in the stop condition. if the s-bit is set, the stop opcode is treated as a no-op (nop). the stop condition offers minimum power consumption because all clocks, including the crystal oscillator, are stopped while in this mode. to exit stop and resume normal processing, a logic low level must be applied to one of the external interrupts (irq or xirq ) or to the reset pin. a pending edge-triggered irq can also bring the cpu out of stop. because all clocks are stopped in this mode, all internal peripheral functions also stop. the data in the internal ram is retained as long as v dd power is maintained. the cpu state and i/o pin levels are static and are unchanged by stop. therefore, when an interrupt comes to restart the system, the mcu resumes processing as if there were no interruption. if reset is used to restart the system a normal reset sequence results where all i/o pins and functions are also restored to their initial states. to use the irq pin or the xirq pin as a means of recovering from stop, the i-bit or the x-bit in ccr respectively must be clear. (irq or xirq not masked). because the oscillator is stopped in stop mode, a restart delay may be imposed to allow oscillator stabilization upon leaving stop. if the internal oscillator is being used, this delay is required; however, if a stable external oscillator is being used, the dly control bit can be used to bypass this start-up delay. the dly control bit is set by reset and can be optionally cleared during initialization. if the dly equal to zero option is used to avoid start-up delay on recovery from stop, then reset should not be used as the means of recovering from stop, as this causes dly to be set again by reset, imposing the restart delay. this same delay also applies to power-on-reset, regardless of the state of the dly control bit, but does not apply to a reset while the clocks are running. see section 4.3.2.4. tpg 99
motorola 5-18 mc68hc11pa8 resets and interrupts 5 figure 5-1 processing ?w out of reset (1 of 2) xirq pin low? clock monitor fail (cme = 1) cop watchdog timeout (nocop = 0) begin an instruction sequence external reset power-on reset (por) delay (128/4064 cycles ? ) load program counter with contents of $fffc, $fffd (vector fetch) load program counter with contents of $fffe, $ffff (vector fetch) load program counter with contents of $fffa, $fffb (vector fetch) set s, x, and i bits in ccr. reset mcu hardware x-bit in ccr set? stack cpu registers. set x and i bits. fetch vector at $fff4, $fff5 1a 1b no no ye s ye s priority highest lowest ? see section 5.1.1 tpg 100
mc68hc11pa8 motorola 5-19 resets and interrupts 5 figure 5-2 processing ?w out of reset (2 of 2) rti? fetch opcode swi? stack cpu registers. set i bit. fetch vector at $fff8, $fff9 1b 1a i-bit in ccr set? i-bit interrupt pending? legal opcode? wai? execute this instruction ye s no no ye s no no no stack cpu registers. set i bit. fetch vector at $fff6, $fff7 restore cpu registers from stack ye s ye s no stack cpu registers stack cpu registers interrupt yet? set i-bit resolve interrupt priority and fetch vector for highest pending source (figure 5-3) ye s ye s no start next instruction sequence ye s tpg 101
motorola 5-20 mc68hc11pa8 resets and interrupts 5 figure 5-3 interrupt priority resolution (1 of 3) x-bit in ccr set? highest priority interrupt? rtii = 1? ic1i = 1? ic2i = 1? ic3i = 1? oc1i = 1? begin irq ? 2a xirq pin low? set x-bit in ccr. fetch vector at $fff4, $fff5 fetch vector fetch vector at $fff2, $fff3 fetch vector at $fff0, $fff1 fetch vector at $ffee, $ffef fetch vector at $ffec, $ffed fetch vector at $ffea, $ffeb no ye s fetch vector at $ffe8, $ffe9 rtif = 1? ic1f = 1? ic2f = 1? ic3f = 1? oc1f = 1? 2b ye s ye s ye s ye s ye s ye s ye s no no no no no no no ye s ye s ye s ye s ye s no no no no no no ye s tpg 102
mc68hc11pa8 motorola 5-21 resets and interrupts 5 figure 5-4 interrupt priority resolution (2 of 3) oc2i = 1? oc3i = 1? oc4i = 1? i4/o5i = 1? 2a fetch vector at $ffe6, $ffe7 fetch vector at $ffe4, $ffe5 fetch vector at $ffe2, $ffe3 fetch vector at $ffe0, $ffe1 oc2f = 1? oc3f = 1? oc4f = 1? i4/o5f = 1? 2b ye s ye s ye s ye s no no no ye s ye s ye s ye s no no no no 2c 2d toi = 1? fetch vector at $ffde, $ffdf tof = 1? ye s no ye s no no mien = 1? mif = 1? fetch vector at $ffd4, $ffd5 ye s ye s no no tpg 103
motorola 5-22 mc68hc11pa8 resets and interrupts 5 figure 5-5 interrupt priority resolution (3 of 3) 2c paii = 1? fetch vector at $ffda, $ffdb paif = 1? 2d ye s no ye s no sci interrupt? ? spie = 1? fetch vector at $ffd8, $ffd9 spif = 1? ye s no ye s no modf = 1? no no ye s ye s fetch vector at $fff2, $fff3 spurious interrupt ?take irq vector end ? refer to figure 5-6 for further details on sci interrupts. fetch vector at $ffd6, $ffd7 paovi = 1? fetch vector at $ffdc, $ffdd paovf = 1? ye s no ye s no tpg 104
mc68hc11pa8 motorola 5-23 resets and interrupts 5 figure 5-6 interrupt source resolution within the sci subsystem no begin rdrf = 1? or = 1? tdre = 1? tc = 1? idle = 1? no valid sci interrupt request rie = 1? te = 1? re = 1? tie = 1? tcie = 1? ilie = 1? re = 1? valid sci interrupt request ye s ye s ye s ye s ye s ye s ye s ye s ye s ye s ye s ye s no no no no no no no no no no no tpg 105
motorola 5-24 mc68hc11pa8 resets and interrupts 5 this page left blank intentionally tpg 106
mc68hc11pa8 motorola 6-1 parallel input/output 6 6 parallel input/output the mc68hc(7)11pa8/mc68hc(7)11pb8 has up to 39 input/output lines and 10 input-only lines ? (including the xirq and irq pins), depending on the operating mode. to enhance the i/o functions, the data bus of this microcontroller is non-multiplexed. the following table is a summary of the con?uration and features of each port. note: do not confuse pin function with the electrical state of that pin at reset. all general-purpose i/o pins that are con?ured as inputs at reset are in a high-impedance state and the contents of the port data registers are unde?ed; in port descriptions, a ? indicates this condition. the pin function is mode dependent. ? pins pe5 and pe4 are not present on the 64-pin qfp packaged mc68hc11pa8, which has only six port e pins. they are present on the 64-pin mc68hc11pb8 and on 68-pin clcc packages (available as samples only). contact your local motorola sales of?e for more information. table 6-1 port con?uration port input pins output pins bidirectional pins alternative functions a 8 timer b 8 high order address c 8 data bus d 6 sci and spi / i 2 c bus e8 ? a/d converter / i 2 c bus f 8 low order address g 1 r/w tpg 107
motorola 6-2 mc68hc11pa8 parallel input/output 6 6.1 port a port a is an 8-bit bidirectional port, with both data and data direction registers. in addition to their i/o capability, port a pins are shared with timer functions, as shown in the following table. on reset the pins are con?ured as general purpose high-impedance inputs. 6.1.1 porta ?port a data register this is a read/write register and is not affected by reset. the bits may be read and written at any time, but, when a pin is allocated to its alternative function, a write to the corresponding register bit has no effect on the pin state. 6.1.2 ddra ?data direction register for port a dda[7:0] ?data direction for port a 1 (set) the corresponding pin is con?ured as an output. 0 (clear) the corresponding pin is con?ured as an input. pin alternative function pa0 ic3 pa1 ic2 pa2 ic1 pa3 oc5 and/or oc1, or ic4 pa4 oc4 and/or oc1 pa5 oc3 and/or oc1 pa6 oc2 and/or oc1 pa7 pai and/or oc1 address bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 state on reset port a data (porta) $0000 pa7 pa6 pa5 pa4 pa3 pa2 pa1 pa0 unde?ed address bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 state on reset data direction a (ddra) $0001 dda7 dda6 dda5 dda4 dda3 dda2 dda1 dda0 0000 0000 ? ? see section 10 for more information. tpg 108
mc68hc11pa8 motorola 6-3 parallel input/output 6 6.2 port b port b is an 8-bit bidirectional port, with both data and data direction registers. in addition to their i/o capability, port b pins are used as the non-multiplexed high order address pins, as shown in the following table. the state of the pins on reset is mode dependent. in single chip or bootstrap mode, port b pins are high-impedance inputs with selectable internal pull-up resistors (see section 6.9). in expanded or test mode, port b pins are high order address outputs and portb/ddrb are not in the memory map. 6.2.1 portb ?port b data register the bits may be read and written at any time and are not affected by reset. 6.2.2 ddrb ?data direction register for port b ddb[7:0] ?data direction for port b 1 (set) the corresponding pin is con?ured as an output. 0 (clear) the corresponding pin is con?ured as an input. pin alternative function pb0 a8 pb1 a9 pb2 a10 pb3 a11 pb4 a12 pb5 a13 pb6 a14 pb7 a15 address bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 state on reset port b data (portb) $0004 pb7 pb6 pb5 pb4 pb3 pb2 pb1 pb0 unde?ed address bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 state on reset data direction b (ddrb) $0002 ddb7 ddb6 ddb5 ddb4 ddb3 ddb2 ddb1 ddb0 0000 0000 ? ? in expanded or test mode, the pins become the high order address lines and port b is not included in the memory map. tpg 109
motorola 6-4 mc68hc11pa8 parallel input/output 6 6.3 port c port c is an 8-bit bidirectional port, with both data and data direction registers. in addition to their i/o capability, port c pins are used as the non-multiplexed data bus pins, as shown in the following table. the state of the pins on reset is mode dependent. in single chip or bootstrap mode, port c pins are high-impedance inputs. in expanded or test modes, port c pins are the data bus i/o and portc/ddrc are not in the memory map. 6.3.1 portc ?port c data register the bits may be read and written at any time and are not affected by reset. 6.3.2 ddrc ?data direction register for port c ddc[7:0] ?data direction for port c 1 (set) the corresponding pin is con?ured as an output. 0 (clear) the corresponding pin is con?ured as an input. pin alternative function pc0 d0 pc1 d1 pc2 d2 pc3 d3 pc4 d4 pc5 d5 pc6 d6 pc7 d7 address bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 state on reset port c data (portc) $0006 pc7 pc6 pc5 pc4 pc3 pc2 pc1 pc0 unde?ed address bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 state on reset data direction c (ddrc) $0007 ddc7 ddc6 ddc5 ddc4 ddc3 ddc2 ddc1 ddc0 0000 0000 ? ? in expanded or test mode, the pins become the data bus and port c is not included in the memory map. tpg 110
mc68hc11pa8 motorola 6-5 parallel input/output 6 6.4 port d port d is a 6-bit bidirectional port, with both data and data direction registers. in addition to their i/o capability, port d pins are shared with sci and spi or i 2 c bus functions, as shown in the following table. on reset the pins are con?ured as general purpose high-impedance inputs. 6.4.1 portd ?port d data register this is a read/write register and is not affected by reset. the bits may be read and written at any time, but, when a pin is allocated to an alternative function, a write to the corresponding register bit has no effect on the pin state. 6.4.2 ddrd ?data direction register for port d bits [7:6] ?reserved; always read zero ddd[5:0] ?data direction for port d 1 (set) the corresponding pin is con?ured as an output. 0 (clear) the corresponding pin is con?ured as an input. pin alternative function pd0 rxd pd1 txd pd2 miso pd3 mosi / sda pd4 sck / scl pd5 ss address bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 state on reset port d data (portd) $0008 0 0 pd5 pd4 pd3 pd2 pd1 pd0 unde?ed address bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 state on reset data direction d (ddrd) $0009 0 0 ddd5 ddd4 ddd3 ddd2 ddd1 ddd0 0000 0000 see section 9 and section 8 for more information. see section 10 for more information. ? ? ? ? tpg 111
motorola 6-6 mc68hc11pa8 parallel input/output 6 6.5 port e port e is an input-only port. in addition to their input capability, port e pins are shared with a/d and i 2 c bus functions, as shown in the following table. on reset, the pins are con?ured as general purpose high-impedance inputs. 6.5.1 porte ?port e data register this is a read-only register and is not affected by reset. the bits may be read at any time. note: as port e shares pins with the a/d converter, a read of this register may affect any conversion currently in progress, if it coincides with the sample portion of the conversion cycle. hence, normally port e should not be read during the sample portion of any conversion. (1) the xout pin is not available on 64-pin qfp packaged devices, but it is present on the 68-pin clcc package. pins pe4 and pe5 are available on the 64-pin qfp mc68hc11pb8 devices and on all 68-pin clcc devices. pin alternative function pe0 ad0 pe1 ad1 pe2 ad2 pe3 ad3 pe4 ad4 (1) pe5 ad5 (1) pe6 ad6 / scl pe7 ad7 / sda address bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 state on reset port e data (porte) $000a pe7 pe6 pe5 pe4 pe3 pe2 pe1 pe0 unde?ed see section 11 and section 8 for more information. ? ? tpg 112
mc68hc11pa8 motorola 6-7 parallel input/output 6 6.6 port f port f is an 8-bit bidirectional port, with both data and data direction registers. in addition to their i/o capability, port f pins are used as the non-multiplexed low order address pins, as shown in the following table. the state of the pins on reset is mode dependent. in single chip or bootstrap mode, port f pins are high-impedance inputs with selectable internal pull-up resistors (see section 6.9). in expanded or test modes, port f pins are low order address outputs and portf/ddrf are not in the memory map. 6.6.1 portf ?port f data register the bits may be read and written at any time and are not affected by reset. 6.6.2 ddrf ?data direction register for port f ddf[7:0] ?data direction for port f 1 (set) the corresponding pin is con?ured as an output. 0 (clear) the corresponding pin is con?ured as an input. pin alternative function pf0 a0 pf1 a1 pf2 a2 pf3 a3 pf4 a4 pf5 a5 pf6 a6 pf7 a7 address bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 state on reset port f data (portf) $0005 pf7 pf6 pf5 pf4 pf3 pf2 pf1 pf0 unde?ed address bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 state on reset data direction f (ddrf) $0003 ddf7 ddf6 ddf5 ddf4 ddf3 ddf2 ddf1 ddf0 0000 0000 ? ? in expanded or test mode, the pins become the low order address and port f is not included in the memory map. tpg 113
motorola 6-8 mc68hc11pa8 parallel input/output 6 6.7 port g port g is a 1-bit bidirectional port, with both data and data direction registers. in addition to its i/o capability, the single port g pin is shared with the r/w function. pin pg7 is a high-impedance input with a software selectable pull-up resistor in single chip and bootstrap modes (see section 6.9). in expanded or test modes, pg7 is the r/w output. 6.7.1 portg ?port g data register this is a read/write register and is not affected by reset. the bits may be read and written at any time, but, when a pin is allocated to its alternative function, a write to the corresponding register bit has no effect on the pin state. 6.7.2 ddrg ?data direction register for port g ddg7 ?data direction for port g 1 (set) pin pg7 is con?ured as an output. 0 (clear) pin pg7 is con?ured as an input. pin alternative function pg7 r/w address bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 state on reset port g data (portg) $007e pg7 0000000 unde?ed address bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 state on reset data direction g (ddrg) $007f ddg7 0000000 0000 0000 ? ? see section 2 for more information. tpg 114
mc68hc11pa8 motorola 6-9 parallel input/output 6 6.8 xirq and irq pins these two pins may be used as general-purpose inputs. their corresponding data bits, xpin and ipin, are found in the spsr register. the xirq and irq interrupts can be masked using the i and x bits in the ccr (see section 3). 6.8.1 spsr ?spi status register this register can be read at any time, but writing to it has no effect. bits [7, 6, 4] ?see section 9 for details of these bits. bits [5, 3, 2] ? not implemented; always read zero. xpin ?xirq pin input data bit a read of this bit returns the logic level present on the xirq pin. it is not affected by reset. ipin ?irq pin input data bit a read of this bit returns the logic level present on the irq pin. it is not affected by reset. address bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 state on reset spi status (spsr) $0029 spif wcol 0 modf 0 0 xpin ipin 0000 00uu tpg 115
motorola 6-10 mc68hc11pa8 parallel input/output 6 6.9 internal pull-up resistors three of the ports (b, f and g) have internal, software selectable pull-up resistors under control of the port pull-up assignment register (ppar). 6.9.1 ppar ?port pull-up assignment register bits [7:4] ?not implemented; always read zero. bit 3 ?this bit can be written, but has no function. xppue ?port x pin pull-up enable these bits control the on-chip pull-up devices connected to all the pins on i/o ports b, f and g. they are collectively enabled or disabled via the paren bit in the config register (see section 6.10.2). 1 (set) port x pin on-chip pull-up devices enabled. 0 (clear) port x pin on-chip pull-up devices disabled. note: gppue, fppue and bppue have no effect in expanded mode since ports f and b are dedicated address bus outputs, and port g provides the r/w signal. 6.10 system con?uration one bit in each of the following registers is directly concerned with the con?uration of the i/o ports. for full details on the other bits in the registers, refer to the appropriate section. address bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 state on reset port pull-up assignment (ppar) $002c 00001 gppue fppue bppue 0000 1111 tpg 116
mc68hc11pa8 motorola 6-11 parallel input/output 6 6.10.1 opt2 ?system con?uration options register 2 lirdv ?lir driven (refer to section 4) 1 (set) enable lir drive high pulse. 0 (clear) lir not driven on moda/lir pin. cwom ?port c wired-or mode 1 (set) port c outputs are open-drain. 0 (clear) port c operates normally. strch ?stretch external accesses (refer to section 4) 1 (set) off-chip accesses are extended by one e clock cycle. 0 (clear) normal operation. irvne ?internal read visibility/not e (refer to section 4) 1 (set) data from internal reads is driven out of the external data bus. 0 (clear) no visibility of internal reads on external bus. in single chip mode this bit determines whether the e clock drives out from the chip. 1 (set) e pin is driven low. 0 (clear) e clock is driven out from the chip. lsbf ?lsb ?st enable (refer to section 9) 1 (set) spi data is transferred lsb ?st. 0 (clear) spi data is transferred msb ?st. spr2 ?spi clock rate select (refer to section 9) ext4x ?xout clock output select (refer to section 4) 1 (set) extali clock is output on the xout pin. 0 (clear) 4xclk clock is output on the xout pin. note: the xout pin is not available on 64-pin qfp packaged devices; see section 4. address bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 state on reset system con?. options 2 (opt2) $0038 lirdv cwom strch irvne lsbf spr2 ext4x xirqe x 00x 0000 tpg 117
motorola 6-12 mc68hc11pa8 parallel input/output 6 xirqe ?con?ure xirq for falling-edge-sensitive operation (refer to section 4) 1 (set) falling-edge-sensitive operation. 0 (clear) low-level-sensitive operation. 6.10.2 config ?system con?uration register romad ?rom/ eprom mapping control (refer to section 4) 1 (set) rom/ eprom addressed from $4000 to $ffff. 0 (clear) rom/ eprom addressed from $0000 to $bfff (expanded mode only). mbsp?synchronous serial interface select (refer to section 4) 1 (set) if enabled, i 2 c bus uses port d[4, 3] pins; spi is disabled. 0 (clear) if enabled, i 2 c bus uses port e[7, 6] pins. clk4x ?4x clock enable (refer to section 4) 1 (set) 4xclk or extali driven out on the xout pin. 0 (clear) xout pin disabled. note: the xout pin is not available on 64-pin qfp packaged devices; see section 4. paren ?pull-up assignment register enable 1 (set) pull-ups can be enabled using ppar register. 0 (clear) all pull-ups disabled. nosec ?eeprom security disabled (refer to section 4) 1 (set) disable security. 0 (clear) enable security. address bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 state on reset con?uration control (config) $003f romad mbsp clk4x paren nosec nocop romon eeon xxxx xxxx tpg 118
mc68hc11pa8 motorola 6-13 parallel input/output 6 nocop ?cop system disable (refer to section 5) 1 (set) cop system disabled. 0 (clear) cop system enabled (forces reset on timeout). romon ?rom/ eprom enable (refer to section 4) 1 (set) rom/ eprom present in the memory map. 0 (clear) rom/ eprom disabled from the memory map. eeon ?eeprom enable (refer to section 4) 1 (set) eeprom is present in the memory map. 0 (clear) eeprom is disabled from the memory map. tpg 119
motorola 6-14 mc68hc11pa8 parallel input/output 6 this page left blank intentionally tpg 120
mc68hc11pa8 motorola 7-1 serial communications interface 7 7 serial communications interface the serial communications interface (sci) is a universal asynchronous receiver transmitter (uart). it has a non-return to zero (nrz) format (one start, eight or nine data, and one stop bit) that is compatible with standard rs-232 systems. the sci shares i/o with two of port ds pins: the sci transmit and receive functions are enabled by te and re respectively, in sccr2. the sci features enabled on this mcu include: 13-bit modulus prescaler, idle line detect, receiver-active ?g, transmitter and receiver hardware parity. a block diagram of the enhanced baud rate generator is shown in figure 7-1. see table 7-1 for example baud rate control values. pin alternative function pd0 rxd pd1 txd figure 7-1 sci baud rate generator circuit diagram 13-bit compare sync scbdh/l : sci baud control 13-bit counter ? 2 internal phase 2 clock receiver baud rate clock ? 16 transmitter baud rate clock st4xck reset eq tpg 121
motorola 7-2 mc68hc11pa8 serial communications interface 7 7.1 data format the serial data format requires the following conditions: an idle-line condition before transmission or reception of a message. a start bit, logic zero, transmitted or received, that indicates the start of each character. data that is transmitted and received least signi?ant bit (lsb) ?st. a stop bit, logic one, used to indicate the end of a frame. (a frame consists of a start bit, a character of eight or nine data bits, and a stop bit.) a break (de?ed as the transmission or reception of a logic zero for some multiple number of frames). selection of the word length is controlled by the m bit of sccr1. 7.2 transmit operation the sci transmitter includes a parallel data register (scdrh/scdrl) and a serial shift register. the contents of the shift register can only be written through the parallel data register. this double buffered operation allows a character to be shifted out serially while another character is waiting in the parallel data register to be transferred into the shift register. the output of the shift register is applied to txd as long as transmission is in progress or the transmit enable (te) bit of serial communication control register 2 (sccr2) is set. the block diagram, figure 7-2, shows the transmit serial shift register and the buffer logic at the top of the ?ure. 7.3 receive operation during receive operations, the transmit sequence is reversed. the serial shift register receives data and transfers it to the parallel receive data registers (scdrh/scdrl) as a complete word. this double buffered operation allows a character to be shifted in serially while another character is still in the serial data registers. an advanced data recovery scheme distinguishes valid data from noise in the serial data stream. the data input is selectively sampled to detect receive data, and majority sampling logic determines the value and integrity of each bit. tpg 122
mc68hc11pa8 motorola 7-3 serial communications interface 7 figure 7-2 sci block diagram loops woms wake + & & & & & ? m ilt pe pt sccr1 10/11-bit tx shift register h8 l 0 7 10/11-bit rx shift register 80 7 tie tcie te rie ilie re rwu sbk sccr2 tdre tc or rdrf idle nf fe pf scsr1 raf scsr2 data recovery rxd txd scdrh/scdrl (receive buffer) r8 scdrh/scdrl (transmit buffer) t8 transmitter control receiver control loops sci interrupt request woms woms m pe pt te sbk wake pe pt re rwu m loops ilt stop start scbdl scbdh rate generator st4xck or rie rie idle ilie rdrf tc tcie tdre tie note: ? = always reads as zero flag control internal data bus clock tpg 123
motorola 7-4 mc68hc11pa8 serial communications interface 7 7.4 wake-up feature the wake-up feature reduces sci service overhead in multiple receiver systems. software for each receiver evaluates the ?st character or frame of each message. all receivers are placed in wake-up mode by writing a one to the rwu bit in the sccr2 register. when rwu is set, the receiver-related status ?gs (rdrf, idle, or, nf, fe, and pf) are inhibited (cannot be set). although rwu can be cleared by a software write to sccr2, to do so would be unusual. normally rwu is set by software and is cleared automatically with hardware. whenever a new message begins, logic alerts the dormant receivers to wake up and evaluate the initial character of the new message. two methods of wake-up are available: idle-line wake-up and address mark wake-up. during idle-line wake-up, a dormant receiver activates as soon as the rxd line becomes idle. in the address mark wake-up, logic one in the most signi?ant bit (msb) of a character activates all sleeping receivers. to use either receiver wake-up method, establish a software addressing scheme to allow the transmitting devices to direct messages to individual receivers or to groups of receivers. this addressing scheme can take any form as long as all transmitting and receiving devices are programmed to understand the same scheme. 7.4.1 idle-line wake-up clearing the wake bit in sccr1 register enables idle-line wake-up mode. in idle-line wake-up mode, all receivers are active (rwu bit in sccr2 = 0) when each message begins. the ?st frames of each message are addressing frames. each receiver in the system evaluates the addressing frames of a message to determine if the message is intended for that receiver. when a receiver ?ds that the message is not intended for it, it sets the rwu bit. once set, the rwu control bit disables all but the necessary receivers for the remainder of the message, thus reducing software overhead for the remainder of that message. as soon as an idle line is detected by receiver logic, hardware automatically clears the rwu bit so that the ?st frames of the next message can be evaluated by all receivers in the system. this type of receiver wake-up requires a minimum of one idle frame time between messages, and no idle time between frames within a message. 7.4.2 address-mark wake-up setting the wake bit in sccr1 register enables address-mark wake-up mode. the address-mark wake-up method uses the msb of each frame to differentiate between address information (msb = 1) and actual message data (msb = 0). all frames consist of seven information bits (eight bits if m bit in sccr1 = 1) and an msb which, when set to one, indicates an address frame. the ?st frames of each message are addressing frames. receiver logic evaluates these marked frames to determine the receivers for which that message is intended. when a receiver ?ds that the message is not intended for it, it sets the rwu bit. once set, the rwu control bit disables all but the necessary receivers for the remainder of the message, thus reducing software overhead tpg 124
mc68hc11pa8 motorola 7-5 serial communications interface 7 for the remainder of that message. when the next message begins, its ?st frame will have the msb set which will automatically clear the rwu bit and indicate that this is an addressing frame. this frame is always the ?st frame received after wake-up because the rwu bit is cleared before the stop bit for the ?st frame is received. this method of wake-up allows messages to include idle times, however, there is a loss in ef?iency due to the extra bit time required for the address bit in each frame. 7.5 sci error detection four error conditions can occur during sci operation. these error conditions are: serial data register overrun, received bit noise, framing, and parity error. four bits (or, nf, fe, and pf) in serial communications status register 1 (scsr1) indicate if one of these error conditions exists. the overrun error (or) bit is set when the next byte is ready to be transferred from the receive shift register to the serial data registers (scdrh/scdrl) and the registers are already full (rdrf bit is set). when an overrun error occurs, the data that caused the overrun is lost and the data that was already in serial data registers is not disturbed. the or is cleared when the scsr is read (with or set), followed by a read of the sci data registers. the noise ?g (nf) bit is set if there is noise on any of the received bits, including the start and stop bits. the nf bit is not set until the rdrf ?g is set. the nf bit is cleared when the scsr is read (with fe equal to one) followed by a read of the sci data registers. when no stop bit is detected in the received data character, the framing error (fe) bit is set. fe is set at the same time as the rdrf. if the byte received causes both framing and overrun errors, the processor only recognizes the overrun error. the framing error ?g inhibits further transfer of data into the sci data registers until it is cleared. the fe bit is cleared when the scsr is read (with fe equal to one) followed by a read of the sci data registers. the parity error ?g (pf) is set if received data has incorrect parity. the ?g is cleared by a read of scsr1 with pe set, followed by a read of scdr. 7.6 sci registers there are eight addressable registers in the sci. scbdh, scbdl, sccr1, and sccr2 are control registers. the contents of these registers control functions and indicate conditions within the sci. the status registers scsr1 and scsr2 contain bits that indicate certain conditions within the sci. scdrh and scdrl are sci data registers. these double buffered registers are used for the transmission and reception of data, and are used to form the 9-bit data word for the sci. if the sci is being used with 7 or 8-bit data, only scdrl needs to be accessed. note that if 9-bit data format is used, the upper register should be written ?st to ensure that it is transferred to the transmitter shift register with the lower register. tpg 125
motorola 7-6 mc68hc11pa8 serial communications interface 7 7.6.1 scbdh, scbdl ?sci baud rate control registers the contents of this register determine the baud rate of the sci. btst ?baud register test (test mode only) bspl ?baud rate counter split (test mode only) brst ?baud rate reset (test mode only) sbr[12:0] ?sci baud rate selects use the following formula to calculate sci baud rate. refer to the table of baud rate control values for example rates: where the baud rate control value (br) is the contents of scbdh/l (br = 1, 2, 3,... 8191). for example, to obtain a baud rate of 1200 with a st4xck frequency of 12mhz, the baud register (scbdh/l) should contain $0138 (see table 7-1). the clock rate generator is disabled if br = 0, or if neither the receiver nor transmitter is enabled (both re and te in sccr2 are cleared). writes to the baud rate registers will only be successful if the last (or only) byte written is scbdl. the use of an std instruction is recommended as it guarantees that the bytes are written in the correct order. note: st4xck may be the output of the pll circuit or it may be the extal input of the mcu (see section 2.5 and figure 10-1). address bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 state on reset sci baud rate high (scbdh) $0070 btst bspl brst sbr12 sbr11 sbr10 sbr9 sbr8 0000 0000 sci baud rate low (scbdl) $0071 sbr7 sbr6 sbr5 sbr4 sbr3 sbr2 sbr1 sbr0 0000 0100 sci baud rate st4xck 16 2br () ----------------------------- - = tpg 126
mc68hc11pa8 motorola 7-7 serial communications interface 7 7.6.2 sccr1 ?sci control register 1 the sccr1 register provides the control bits that determine word length and select the method used for the wake-up feature. loops ?sci loop mode enable 1 (set) sci transmit and receive are disconnected from txd and rxd pins, and transmitter output is fed back into the receiver input. 0 (clear) sci transmit and receive operate normally. both the transmitter and receiver must be enabled to use the loop mode. when the loop mode is enabled, the txd pin is driven high (idle line state) if the transmitter is enabled. woms ?wired-or mode for sci pins (pd1, pd0) 1 (set) txd and rxd are open drains if operating as outputs. 0 (clear) txd and rxd operate normally. bit 5 ?not implemented; always reads zero table 7-1 example sci baud rate control values target baud rate st4xck frequency 8 mhz 12 mhz 16 mhz dec value hex value dec value hex value dec value hex value 110 2272 $08e0 3409 $0d51 4545 $11c1 150 1666 $0682 2500 $09c4 3333 $0d05 300 833 $0341 1250 $04e2 1666 $0682 600 416 $01a0 625 $0271 833 $0341 1200 208 $00d0 312 $0138 416 $01a0 2400 104 $0068 156 $009c 208 $00d0 4800 52 $0034 78 $004e 104 $0068 9600 26 $001a 39 $0027 52 $0034 19200 13 $000d 20 $0014 26 $001a 38400 13 $000d address bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 state on reset sci control 1 (sccr1) $0072 loops woms 0 m wake ilt pe pt 0000 0000 tpg 127
motorola 7-8 mc68hc11pa8 serial communications interface 7 m ?mode (select character format) 1 (set) start bit, 9 data bits, 1 stop bit. 0 (clear) start bit, 8 data bits, 1 stop bit. wake ?wake-up by address mark/idle 1 (set) wake-up by address mark (most signi?ant data bit set). 0 (clear) wake-up by idle line recognition. ilt ?idle line type 1 (set) long (sci counts ones only after stop bit). 0 (clear) short (sci counts consecutive ones after start bit). this bit determines which of two types of idle line detection method is used by the sci receiver. in short mode the stop bit and any bits that were ones before the stop bit will be considered as part of that string of ones, possibly resulting in erroneous or premature detection of an idle line condition. in long mode the sci system does not begin counting ones until a stop bit is received. pe ?parity enable 1 (set) parity enabled. 0 (clear) parity disabled. pt ?parity type 1 (set) parity odd (an odd number of ones causes parity bit to be zero, an even number of ones causes parity bit to be one). 0 (clear) parity even (an even number of ones causes parity bit to be zero, an odd number of ones causes parity bit to be one). tpg 128
mc68hc11pa8 motorola 7-9 serial communications interface 7 7.6.3 sccr2 ?sci control register 2 the sccr2 register provides the control bits that enable or disable individual sci functions. tie ?transmit interrupt enable 1 (set) sci interrupt requested when tdre status ?g is set. 0 (clear) tdre interrupts disabled. tcie ?transmit complete interrupt enable 1 (set) sci interrupt requested when tc status ?g is set. 0 (clear) tc interrupts disabled. rie ?receiver interrupt enable 1 (set) sci interrupt requested when rdrf ?g or the or status ?g is set. 0 (clear) rdrf and or interrupts disabled. ilie ?idle line interrupt enable 1 (set) sci interrupt requested when idle status ?g is set. 0 (clear) idle interrupts disabled. te ?transmitter enable 1 (set) transmitter enabled. 0 (clear) transmitter disabled. re ?receiver enable 1 (set) receiver enabled. 0 (clear) receiver disabled. rwu ?receiver wake-up control 1 (set) wake-up enabled and receiver interrupts inhibited. 0 (clear) normal sci receiver. sbk ?send break 1 (set) break codes generated as long as sbk is set. 0 (clear) break generator off. address bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 state on reset sci control 2 (sccr2) $0073 tie tcie rie ilie te re rwu sbk 0000 0000 tpg 129
motorola 7-10 mc68hc11pa8 serial communications interface 7 7.6.4 scsr1 ?sci status register 1 the bits in scsr1 indicate certain conditions in the sci hardware and are automatically cleared by special acknowledge sequences. tdre ?transmit data register empty ?g 1 (set) scdr empty. 0 (clear) scdr busy. this ?g is set when scdr is empty. clear the tdre ?g by reading scsr1 with tdre set and then writing to scdr. tc ?transmit complete ?g 1 (set) transmitter idle. 0 (clear) transmitter busy. this ?g is set when the transmitter is idle (no data, preamble, or break transmission in progress). clear the tc ?g by reading scsr1 with tc set and then writing to scdr. rdrf ?receive data register full ?g 1 (set) scdr full. 0 (clear) scdr empty. once cleared, idle is not set again until the rxd line has been active and becomes idle again. rdrf is set if a received character is ready to be read from scdr. clear the rdrf ?g by reading scsr1 with rdrf set and then reading scdr. idle ?idle line detected ?g 1 (set) rxd line is idle. 0 (clear) rxd line is active. this ?g is set if the rxd line is idle. once cleared, idle is not set again until the rxd line has been active and becomes idle again. the idle ?g is inhibited when rwu = 1. clear idle by reading scsr1 with idle set and then reading scdr. address bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 state on reset sci status 1 (scsr1) $0074 tdre tc rdrf idle or nf fe pf 1100 0000 tpg 130
mc68hc11pa8 motorola 7-11 serial communications interface 7 or ?overrun error ?g 1 (set) overrun detected. 0 (clear) no overrun. or is set if a new character is received before a previously received character is read from scdr. clear the or ?g by reading scsr1 with or set and then reading scdr. nf ?noise error ?g 1 (set) noise detected. 0 (clear) unanimous decision. nf is set if the majority sample logic detects anything other than a unanimous decision. clear nf by reading scsr1 with nf set and then reading scdr. fe ?framing error 1 (set) zero detected. 0 (clear) stop bit detected. fe is set when a zero is detected where a stop bit was expected. clear the fe ?g by reading scsr1 with fe set and then reading scdr. pf ?parity error ?g 1 (set) incorrect parity detected. 0 (clear) parity correct. pf is set if received data has incorrect parity. clear pf by reading scsr1 with pe set and then reading scdr. tpg 131
motorola 7-12 mc68hc11pa8 serial communications interface 7 7.6.5 scsr2 ?sci status register 2 in the scsr2 only bit 0 is used, to indicate receiver active. the other seven bits always read zero. bits [7:1] ?not implemented; always read zero raf ?receiver active ?g (read only) 1 (set) a character is being received. 0 (clear) a character is not being received. 7.6.6 scdrh, scdrl ?sci data high/low registers scdrh/scdrl is a parallel register that performs two functions. it is the receive data register when it is read, and the transmit data register when it is written. reads access the receive data buffer and writes access the transmit data buffer. data received or transmitted is double buffered. if the sci is being used with 7 or 8-bit data, only scdrl needs to be accessed. note that if 9-bit data format is used, the upper register should be written ?st to ensure that it is transferred to the transmitter shift register with the lower register. r8 ?receiver bit 8 ninth serial data bit received when sci is con?ured for a nine data bit operation t8 ?transmitter bit 8 ninth serial data bit transmitted when sci is con?ured for a nine data bit operation bits [5:0] ?not implemented; always read zero r/t[7:0] ?receiver/transmitter data bits [7:0] sci data is double buffered in both directions. address bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 state on reset sci status 2 (scsr2) $0075 0000000raf 0000 0000 address bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 state on reset sci data high (scdrh) $0076 r8 t8 000000 unde?ed sci data low (scdrl) $0077 r7t7 r6t6 r5t5 r4t4 r3t3 r2t2 r1t1 r0t0 unde?ed tpg 132
mc68hc11pa8 motorola 7-13 serial communications interface 7 7.7 status ?gs and interrupts the sci transmitter has two status ?gs. these status ?gs can be read by software (polled) to tell when certain conditions exist. alternatively, a local interrupt enable bit can be set to enable each of these status conditions to generate interrupt requests. status ?gs are automatically set by hardware logic conditions, but must be cleared by software. this provides an interlock mechanism that enables logic to know when software has noticed the status indication. the software clearing sequence for these ?gs is automatic ?functions that are normally performed in response to the status ?gs also satisfy the conditions of the clearing sequence. tdre and tc ?gs are normally set when the transmitter is ?st enabled (te set to one). the tdre ?g indicates there is room in the transmit queue to store another data character in the transmit data register. the tie bit is the local interrupt mask for tdre. when tie is zero, tdre must be polled. when tie and tdre are one, an interrupt is requested. the tc ?g indicates the transmitter has completed the queue. the tcie bit is the local interrupt mask for tc. when tcie is zero, tc must be polled; when tcie is one and tc is one, an interrupt is requested. writing a zero to te requests that the transmitter stop when it can. the transmitter completes any transmission in progress before shutting down. only an mcu reset can cause the transmitter to stop and shut down immediately. if te is cleared when the transmitter is already idle, the pin reverts to its general purpose i/o function (synchronized to the bit-rate clock). if anything is being transmitted when te is cleared, that character is completed before the pin reverts to general purpose i/o, but any other characters waiting in the transmit queue are lost. the tc and tdre ?gs are set at the completion of this last character, even though te has been disabled. 7.7.1 receiver ?gs the sci receiver has seven status ?gs, three of which can generate interrupt requests. the status ?gs are set by the sci logic in response to speci? conditions in the receiver. these ?gs can be read (polled) at any time by software. refer to figure 7-3, which shows sci interrupt arbitration. when an overrun takes place, the new character is lost, and the character that was in its way in the parallel receive data register (rdr) is undisturbed. rdrf is set when a character has been received and transferred into the parallel rdr. the or ?g is set instead of rdrf if overrun occurs. a new character is ready to be transferred into the rdr before a previous character is read from the rdr. the nf, fe and pf ?gs provide additional information about the character in the rdr, but do not generate interrupt requests. the receiver active ?g (raf) indicates that the receiver is busy. the last receiver status ?g and interrupt source come from the idle ?g. the rxd line is idle if it has constantly been at logic one for a full character time. the idle ?g is set only after the rxd line has been busy and becomes idle. this prevents repeated interrupts for the time rxd remains idle. tpg 133
motorola 7-14 mc68hc11pa8 serial communications interface 7 figure 7-3 interrupt source resolution within sci no begin rdrf = 1? or = 1? tdre = 1? tc = 1? idle = 1? no valid sci interrupt request rie = 1? te = 1? re = 1? tie = 1? tcie = 1? ilie = 1? re = 1? valid sci interrupt request ye s ye s ye s ye s ye s ye s ye s ye s ye s ye s ye s ye s no no no no no no no no no no no tpg 134
mc68hc11pa8 motorola 8-1 i 2 c bus 8 8 i 2 c bus ? the i 2 c bus is a two wire, bidirectional serial bus that provides a simple, ef?ient way to exchange data between devices. being a two-wire device, the i 2 c bus minimizes the need for large numbers of connections between devices, and eliminates the need for an address decoder. this interface is suitable for applications involving frequent communications between a number of devices over short distances. the number of devices connected to the i 2 c bus is limited only by a maximum bus capacitance of 400pf; it has a maximum data rate of 100 kbits per second. the i 2 c bus system is a true multi-master bus including collision detection and arbitration to prevent data corruption if two or more masters intend to control the bus simultaneously. this feature provides the capability for complex applications with multi-processor control. the system shares i/o either with two of port es pins, or with two of port ds pins, depending on the state of the mbsp bit in the config register: the men bit in the i 2 c bus control register (mcr) enables the i 2 c function. ?i 2 c bus is a proprietary philips interface bus. mbsp i 2 c bus function pin 1 scl pd4 sda pd3 0 scl pe7 sda pe6 tpg 135
motorola 8-2 mc68hc11pa8 i 2 c bus 8 8.1 i 2 c bus features multi-master operation software-programmable for one of 32 different serial clock frequencies software-selectable acknowledge bit interrupt-driven byte-by-byte data transfer arbitration-lost-driven interrupt with automatic switching from master to slave mode calling address identi?ation interrupt generates/detects the start or stop signal repeated start signal generation generates/recognizes the acknowledge bit bus busy detection 8.2 i 2 c bus system con?uration the i 2 c bus system uses a serial data line and a serial clock line for the transfer of data. all the devices connected to the i 2 c bus must have open drain or open collector outputs; a logic ?nd function is used on both lines with two pull-up resistors. although the i 2 c bus operates in an open-drain con?uration, the port d drivers are implemented but in the off state (mbsp = 1). this means that it is not possible to bring the scl or sda lines more than 0.5v above the v dd level due to intrinsic on-chip diodes. when mbsp = 0, this restriction does not apply to port e (however, maximum ratings restrictions do apply). 8.3 i 2 c bus protocol a standard communication is normally composed of four parts: start signal, slave address transmission, data transfer, and stop signal. these signals are described in the following sections and illustrated in figure 8-1. tpg 136
mc68hc11pa8 motorola 8-3 i 2 c bus 8 figure 8-1 i 2 c bus transmission signal diagrams scl sda scl sda acknowledge bit no acknowledge acknowledge bit no acknowledge msb lsb msb lsb msb lsb msb lsb start signal stop signal repeated start signal start signal stop signal tpg 137
motorola 8-4 mc68hc11pa8 i 2 c bus 8 8.3.1 start signal when the bus is free (no master device engaging the bus; scl and sda lines are at a logic high), a master may initiate communication by sending a start signal, which is de?ed as being a high to low transition of sda with scl high. this signal denotes the beginning of a new data transfer (each data transfer may contain several bytes of data), and wakes up all slaves. 8.3.2 transmission of the slave address the ?st byte of data transferred after the start signal is the slave address transmitted by the master. this address is seven bits long, followed by a r/w bit which tells the slave the desired direction of transfer of all the following bytes (until a stop or repeated start signal). 8.3.3 data transfer once successful slave addressing has been achieved, the data transfer can proceed byte by byte, in the direction that was speci?d by the r/w bit. data can be changed only when scl is low, and must be held stable while scl is high. the msb is transmitted ?st. each data byte is eight bits long, and there is one clock pulse on scl for each data bit. every byte of data has to be followed by an acknowledge bit, which the receiving device signals by pulling sda low at the ninth clock. therefore, one complete data byte transfer needs nine clock pulses. if the slave receiver does not acknowledge the master, then the sda line is left high by the slave. the master can then generate a stop signal to abort the data transfer or a start signal to commence a new calling (called a repeated start). if the master receiver does not acknowledge the slave transmitter after one byte of transmission, it means ?nd of data to the slave, which then releases the sda line so that the master can generate the stop or start signal. 8.3.4 stop signal the master can terminate the communication by generating a stop signal to free the bus. a stop signal is de?ed as a low to high transition of sda while scl is high (see figure 8-1). tpg 138
mc68hc11pa8 motorola 8-5 i 2 c bus 8 8.3.5 repeated start signal a ?epeated start signal generates a start signal without ?st generating a stop signal to terminate the communication. this is used by the master to communicate with another slave, or with the same slave in a different mode (transmit/receive mode), without releasing the bus. 8.3.6 arbitration procedure the i 2 c bus is a true multi-master system that allows more than one master to be connected to it. if two or more masters try to control the bus at the same time, a clock synchronization procedure determines the bus clock, for which the low period is equal to the longest clock low period and the high period is equal to the shortest clock high period among the masters. a data arbitration procedure determines the relative priority of the contending masters; a master loses arbitration if it transmits logic 1 while another transmits logic 0. the losing master or masters then immediately switch over to slave receive mode and stop all data and clock outputs. the transition from master to slave mode does not generate a stop condition in this case. at this point, the mal bit in the i 2 c bus status register (msr) is set by hardware to indicate loss of arbitration. 8.3.7 clock synchronization since wired-and logic is performed on the scl line, a high to low transition on scl affects all the devices connected on the bus. the devices start counting their low period and once a devices clock has gone low, it holds the scl line low until the clock high state is reached. however, the change of low to high in this device clock may not change the state of the scl line if another device figure 8-2 clock synchronization scl scl1 scl2 internal counter register start counting high period wait tpg 139
motorola 8-6 mc68hc11pa8 i 2 c bus 8 clock is still within its low period. therefore, synchronized clock scl is held low by the device with the longest low period. devices with shorter low periods enter a high wait state during this time (see figure 8-2). when all devices concerned have counted off their low period, the scl line is released and pulled high. there is then no difference between the device clocks and the state of the scl line, and all of them start counting their high periods. the ?st device to complete its high period pulls the scl line low again. 8.3.8 handshaking the clock synchronization mechanism can be used as a handshake in data transfer. the slave device may hold scl low after the completion of one byte of data transfer (nine bits). in such cases, it halts the bus clock and forces the master clock in a wait state until the slave releases the scl line. 8.4 registers 8.4.1 config ?system con?uration register the mbsp bit in this register con?ures the i 2 c bus system; refer to section 4.3.2.1 for details of the other bits. config is made up of eeprom cells and static working latches. the operation of the mcu is controlled directly by these latches and not the eeprom byte. when programming the config register, the eeprom byte is accessed. when the config register is read, the static latches are accessed. these bits can be read at any time. the value read is the one latched into the register from the eeprom cells during the last reset sequence. a new value programmed into this register is not readable until after a subsequent reset sequence. bits in config can be written at any time if smod = 1 (bootstrap or special test mode). if smod = 0 (single chip or expanded mode), they can only be written using the eeprom programming sequence, and are neither readable nor active until latched via the next reset. mbsp ?synchronous serial interface select 1 (set) spi is disabled. the i 2 c bus, if enabled, uses port d[4, 3] pins. 0 (clear) if enabled, the i 2 c bus uses port e[7, 6] pins. when mbsp is cleared, and the i 2 c bus is enabled, a/d channels are not available on port e[7, 6] pins. address bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 state on reset con?uration control (config) $003f romad mbsp clk4x paren nosec nocop romon eeon xxxx xxxx tpg 140
mc68hc11pa8 motorola 8-7 i 2 c bus 8 8.4.2 madr ?i 2 c bus address register madr [7:1] ?slave address bits these bits de?e the slave address of the i 2 c bus, and are used in slave mode in conjunction with the maas bit in the msr register (see section 8.4.5). these bits can be read and written at any time. bit 0 ?not implemented; always reads zero 8.4.3 mfdr ?i 2 c bus frequency divider register mbc[4:0] ?clock rate select bits these bits can be read and written at any time. the serial bit clock frequency is equal to the e clock divided by the value shown in table 8-1. for a 2mhz e clock, the serial bit clock frequency of the i 2 c bus ranges from 460hz to 90909hz. bits [7:5] ?not implemented; always read zero address bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 state on reset i 2 c bus address (madr) $0040 madr7 madr6 madr5 madr4 madr3 madr2 madr1 0 0000 0000 address bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 state on reset i 2 c bus frequency divider (mfdr) $0041 0 0 0 mbc4 mbc3 mbc2 mbc1 mbc0 0000 0000 table 8-1 i 2 c bus prescaler mcb[4:0] divide e clock by mcb[4:0] divide e clock by mcb[4:0] divide e clock by mcb[4:0] divide e clock by 0 0 0 0 0 22 0 1 0 0 0 88 1 0 0 0 0 352 1 1 0 0 0 1408 0 0 0 0 1 24 0 1 0 0 1 96 1 0 0 0 1 384 1 1 0 0 1 1536 0 0 0 1 0 28 0 1 0 1 0 112 1 0 0 1 0 448 1 1 0 1 0 1792 0 0 0 1 1 34 0 1 0 1 1 136 1 0 0 1 1 544 1 1 0 1 1 2176 0 0 1 0 0 44 0 1 1 0 0 176 1 0 1 0 0 704 1 1 1 0 0 2816 0 0 1 0 1 48 0 1 1 0 1 192 1 0 1 0 1 768 1 1 1 0 1 3072 0 0 1 1 0 56 0 1 1 1 0 224 1 0 1 1 0 896 1 1 1 1 0 3584 0 0 1 1 1 68 0 1 1 1 1 272 1 0 1 1 1 1088 1 1 1 1 1 4352 tpg 141
motorola 8-8 mc68hc11pa8 i 2 c bus 8 8.4.4 mcr ?i 2 c bus control register these bits can be read and written at any time. men ?i 2 c bus enable 1 (set) i 2 c bus interface system is enabled. 0 (clear) i 2 c bus interface system is disabled and reset. this bit must be set before any of the other bits in mcr can be set. note: when men is set and mbsp (in config) is clear, the i 2 c bus uses port e pins [7, 6]. when men and mbsp are both set, the i 2 c bus uses port d pins [4, 3]. see section 4. mien ?i 2 c bus interrupt enable 1 (set) i 2 c bus interrupt is requested when mif is set. 0 (clear) i 2 c bus interrupt is disabled. msta ?master/slave mode select 1 (set) master mode; send start signal when set. 0 (clear) slave mode; send stop signal when cleared. this bit is cleared on reset. when msta is changed from 0 to a 1, a start signal is generated on the bus and the master mode is selected. when this bit changes from a 1 to a 0, a stop signal is generated and the slave mode is selected. in master mode, clearing msta and then immediately setting it generates a repeated start signal without generating a stop signal (see figure 8-1). mtx ?transmit/receive mode select 1 (set) transmit mode. 0 (clear) receive mode. txak ?transmit acknowledge bit 1 (set) no acknowledge signal response. 0 (clear) an acknowledge signal will be sent to the bus at the ninth clock bit after receiving one byte of data. this bit only has meaning in master receive mode. bits [2:0] ?not implemented; always read zero. address bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 state on reset i 2 c bus control (mcr) $0042 men mien msta mtx txak 0 0 0 0000 0000 tpg 142
mc68hc11pa8 motorola 8-9 i 2 c bus 8 8.4.5 msr ?i 2 c bus status register bits in this register can be read at any time; bits 4 and 1 can be cleared, but otherwise, writing to these bits has no effect. mcf ?data transferring 1 (set) data transmit complete. 0 (clear) data is being transferred. maas ?i 2 c bus addressed as a slave 1 (set) i 2 c bus is addressed as a slave. 0 (clear) i 2 c bus is not addressed. this bit is set when the address of the i 2 c bus (speci?d in madr) matches the calling address. an interrupt is generated providing the mien bit in the mcr register is set; the cpu then selects its transmit/receive mode according to the state of the srw bit. writing to the mcr register clears this bit. mbb ?bus busy 1 (set) bus is busy. 0 (clear) bus is idle. this bit indicates the status of the bus. when a start signal is detected, mbb is set. when a stop signal is detected, mbb is cleared. mal ?arbitration lost 1 (set) arbitration lost. 0 (clear) default state. mal is set by hardware when the arbitration procedure is lost during a master transmission mode. this bit must be cleared by software. bit 3 ?not implemented; always reads zero. address bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 state on reset i 2 c bus status (msr) $0043 mcf maas mbb mal 0 srw mif rxak 1000 0001 tpg 143
motorola 8-10 mc68hc11pa8 i 2 c bus 8 srw ?read/write command 1 (set) r/w command bit is set (read). 0 (clear) r/w command bit is clear (write). when maas is set, the r/w command bit of the calling address sent from a master is latched into this bit. on checking this bit, the cpu can select slave transmit/receive mode according to the command of the master. mif ?i 2 c bus interrupt ?g 1 (set) an i 2 c bus interrupt is pending. 0 (clear) no i 2 c bus interrupt is pending. when this bit is set, an i 2 c bus interrupt is generated provided the mien bit in the mcr register is set. mif is set when one of the following events occurs: 1) the transfer of one byte of data is complete; mif is set at the falling edge of the ninth clock after the byte has been received. 2) a calling address is received which matches the address of the i 2 c bus in slave receive mode. 3) arbitration is lost. mif must be cleared by software in the interrupt routine. rxak ?received acknowledge bit 1 (set) no acknowledge signal has been detected at the ninth clock after the transmission of a byte of data. 0 (clear) an acknowledge bit has been received at the ninth clock after the transmission of a byte of data. 8.4.6 mdr ?i 2 c bus data register these bits can be read and written at any time. in master transmit mode, a write to this register will cause the data in it to be sent to the bus automatically, msb ?st. in master receive mode, a read of this register initiates the transfer of the next incoming byte of data into the register. see figure 8-3. address bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 state on reset i 2 c bus data (mdr) $0044 trxd7 trxd6 trxd5 trxd4 trxd3 trxd2 trxd1 trxd0 unde?ed tpg 144
mc68hc11pa8 motorola 8-11 i 2 c bus 8 in slave transmit mode, the scl line is forced low until data is written into this register, to prevent transmission. similarly, in slave receive mode, the data bus must be read before a transmission can occur. refer to figure 8-4. 8.5 programming considerations 8.5.1 initialization after a reset, the i 2 c bus control register (mcr) is in a default state. before the i 2 c bus can be used, it must be initialized as follows: 1) con?ure the frequency divider register for the desired scl frequency. 2) con?ure the i 2 c bus address register (madr) to de?e the slave address of the i 2 c bus. 3) set the men bit in the i 2 c bus control register (mcr) to enable the i 2 c system. 4) con?ure the other bits in the mcr register. 8.5.2 start signal and the ?st byte of data after the initialization procedure has been completed, serial data can be transmitted by selecting the ?aster transmitter mode. if the device is connected to a multi-master bus system, the state of the i 2 c bus busy bit (mbb) must be tested to check whether the serial bus is free. if the bus is free (mbb = 0), the start condition and the ?st byte (the slave address) can be sent. an example of a program that does this is shown below: sei ;disable interrupt chflag brset msr #$20 chflag ;check the mbb bit of the status ;register. if it is set, wait ;until it is clear. txstart bset mcr #$10 ;set transmit mode bset mcr #$20 ;set transmit mode ;i.e. generate start condition ldaa calling ;get the calling address staa mdr ;transmit the calling address cli ;enable interrupt tpg 145
motorola 8-12 mc68hc11pa8 i 2 c bus 8 8.5.3 software response the transmission or reception of a byte sets the ?ata transferring bit, mcf, which indicates that one byte of communication is ?ished. also, the i 2 c bus interrupt bit, mif, is set to generate an i 2 c bus interrupt (if mien is set). figure 8-3 and figure 8-4 show an example of a typical i 2 c bus interrupt routine. in the interrupt routine, the ?st step is for software to clear the mif bit. the mcf bit can be cleared by reading from the i 2 c bus data i/o register (mdr) in receive mode, or by writing to mdr in transmit mode. software may service the i 2 c bus i/o in the main program by monitoring the mif bit if the interrupt function is disabled. the following is an example of a software response by a ?aster transmitter in the interrupt routine: isr bclr msr #$02 ;clear the mif flag brclr mcr #$20 slave ;check the msta flag ;branch if slave mode brclr mcr #$10 receive ;check the mode flag brset msr #$01 end ;check acknowledgement from ;receiver ;if no acknowledgement, end of ;transmission transmit ldaa databuf ;get the next byte of data 8.5.4 generation of a stop signal a data transfer ends with a stop signal generated by the master device. a master transmitter can simply generate a stop signal after all the data has been transmitted; for example: mastx brset msr #$01 end ;if no acknowledgement, ;branch to end ldaa txcnt ;get value from the ;transmitting counter beq end ;if no more data, branch to end ldaa databuf ;get next byte of data staa mdr ;transmit the data dec txcnt ;decrease the txcnt bra emastx ;exit end bclr mcr #$20 ;generate a stop condition emastx rti ;return from interrupt if a master receiver wants to terminate a data transfer, it must inform the slave transmitter by not acknowledging the last byte of data. this can be done by setting the transmit acknowledge bit (txak) before reading the second last byte of data. before reading the last byte of data, a stop signal must be generated ?st. the following is an example showing how a stop signal is generated by a master receiver. tpg 146
mc68hc11pa8 motorola 8-13 i 2 c bus 8 masr dec rxcnt beq enmasr ;last byte to be read ldaa rxcnt deca ;check second last byte to be ;read bne nxmar ;not last one or second last lamar bset mcr #$08 ;second last, disable ;acknowledgement transmitting bra nxmar ;nxmar enmasr bclr mcr #$20 ;last one, generate stop signal nxmar ldaa mdr ;read data and store staa rxbuf rti 8.5.5 generation of a repeated start signal at the end of the data transfer, if the master still wants to communicate on the bus, it can generate another start signal, followed by another slave address, without ?st generating a stop signal. for example: restart bclr mcr #$20 ;another start (restart) is ;generated by these two bset mcr #$20 ;consecutive instructions ldaa calling ;get the calling address staa mdr ;transmit the calling address 8.5.6 slave mode in the slave interrupt service routine, the maas bit should be tested to check if a calling of its own address has just been received. if maas is set, software should set the transmit/receive mode select bit (mtx) according to the r/w command bit, srw. writing to the mcr clears the maas bit automatically. a data transfer may then be initiated by writing to mdr or by performing a dummy read from mdr. in slave transmitter routine, the received acknowledge bit (rxak) must be tested before transmitting the next byte of data. if rxak is set, this means an ?nd of data signal from the master receiver, which must then switch from transmitter mode to receiver mode by software. this is followed by a dummy read, which releases the scl line so that the master can generate a stop signal. tpg 147
motorola 8-14 mc68hc11pa8 i 2 c bus 8 8.5.7 arbitration lost only one master can engage the device at one time. those devices wishing to engage the bus, but having lost arbitration, are immediately switched to slave receive mode by hardware. their data output to the sda line is stopped, but the internal transmitting clock is still generated until the end of the byte during which arbitration was lost. an interrupt occurs at the falling edge of the ninth clock of this transfer with mal = 1 and msta = 0. if one master attempts to start transmission while the bus is being engaged by another master, the hardware inhibits the transmission; the msta bit is cleared without generating a stop condition, an interrupt is generated, and mal is set to indicate that the attempt to engage the bus has failed. in these cases, the slave interrupt service routine should test mal ?st; if mal is set, it should be cleared by software. 8.5.8 operation during stop and wait modes during stop mode, the i 2 c bus is disabled. during wait mode, the i 2 c bus is idle, but ?akes up when it receives a valid start condition in slave mode. if the interrupt is enabled, the cpu comes out of wait mode after the end of a byte of transmission. tpg 148
mc68hc11pa8 motorola 8-15 i 2 c bus 8 figure 8-3 example of a typical i 2 c bus interrupt routine (sheet 1 of 2) clear mif set txak = 1 master mode? last byte transmitted? generate stop signal write next byte to mdr read data from mdr and store second last byte to be read? generate stop signal tx/ rx? rxak = 0? last byte to be read? rti a ye s no ye s ye s ye s ye s no no no no rx tx tpg 149
motorola 8-16 mc68hc11pa8 i 2 c bus 8 figure 8-4 example of a typical i 2 c bus interrupt routine (sheet 2 of 2) tx next byte maas = 1? set rx mode write to mdr switch to rx mode ack from receiver? read mdr and store maas = 1? srw = 1? tx / rx? rti ye s no rx ye s no clear mal set tx mode dummy read from mdr dummy read from mdr arbitration lost? a no tx ye s ye s no no ye s tpg 150
mc68hc11pa8 motorola 9-1 serial peripheral interface 9 9 serial peripheral interface the serial peripheral interface (spi), an independent serial communications subsystem, allows the mcu to communicate synchronously with peripheral devices, such as transistor-transistor logic (ttl) shift registers, liquid crystal (lcd) display drivers, analog-to-digital converter subsystems, and other microprocessors. the spi is also capable of inter-processor communication in a multiple master system. the spi system can be con?ured as either a master or a slave device, with data rates as high as one half of the e clock rate when con?ured as a master and as fast as the e clock rate when con?ured as a slave. the spi shares i/o with four of port ds pins and is enabled by spe in the spcr. note: if the mbsp bit in config is set, then the spi is disabled and the i 2 c bus system, if enabled, uses port d pins [4,3]. see section 8. 9.1 functional description the central element in the spi system is the block containing the shift register and the read data buffer (see figure 9-1). the system is single buffered in the transmit direction and double buffered in the receive direction. this means that new data for transmission cannot be written to the shifter until the previous transfer is complete; however, received data is transferred into a parallel read data buffer so the shifter is free to accept a second serial character. as long as the ?st character is read out of the read data buffer before the next serial character is ready to be transferred, no overrun condition occurs. a single mcu register address is used for reading data from the read data buffer and for writing data to the shifter. the spi status block represents the spi status functions (transfer complete, write collision, and mode fault) performed by the serial peripheral status register (spsr). the spi control block represents those functions that control the spi system through the serial peripheral control register (spcr). pin alternative function pd2 miso pd3 mosi / sda pd4 sck / scl pd5 ss tpg 151
motorola 9-2 mc68hc11pa8 serial peripheral interface 9 9.2 spi transfer formats during an spi transfer, data is simultaneously transmitted and received. a serial clock line synchronizes shifting and sampling of the information on the two serial data lines. a slave select line allows individual selection of a slave spi device; slave devices that are not selected do not interfere with spi bus activities. on a master spi device, the select line can optionally be used to indicate a multiple master bus contention. refer to figure 9-2. figure 9-1 spi block diagram spcr ?spi control register spsr ?spi status register divider spdr ?spi data register shift control logic read data buffer 8-bit shift register opt2 ?options register 2 ? 2 ? 4 ? 8 ? 16 ? 32 ? 64 ? 128 select clock logic spi control miso pd2 mosi pd3 sck pd4 ss pd5 s m s m s m pin control logic mcu system clock spie spe dwom mstr cpol cpha spr1 spr0 spif wcol modf lsbf spr2 mstr spe dwom mstr spe spie lsbf clock spi clock (master) spi interrupt request internal bus tpg 152
mc68hc11pa8 motorola 9-3 serial peripheral interface 9 9.2.1 clock phase and polarity controls software can select one of four combinations of serial clock phase and polarity using two bits in the spi control register (spcr). the clock polarity is speci?d by the cpol control bit, which selects an active high or active low clock, and has no signi?ant effect on the transfer format. the clock phase (cpha) control bit selects one of two different transfer formats. the clock phase and polarity should be identical for the master spi device and the communicating slave device. in some cases, the phase and polarity are changed between transfers to allow a master device to communicate with peripheral slaves having different requirements. when cpha equals zero, the ss line must be deasserted and reasserted between each successive serial byte. also, if the slave writes data to the spi data register (spdr) while ss is low, a write collision error results. when cpha equals one, the ss line can remain low between successive transfers. 9.3 spi signals the following paragraphs contain descriptions of the four spi signals: master in slave out (miso), master out slave in (mosi), serial clock (sck), and slave select (ss ). any spi output line must have its corresponding data direction bit in ddrd register set. if the ddr bit is clear, that line is disconnected from the spi logic and becomes a general-purpose input. all spi input lines are forced to act as inputs regardless of the state of the corresponding ddr bits in ddrd register. figure 9-2 spi transfer format 1 2 3 4 5 6 7 8 msb654321lsb msb654321 lsb sck cycle # (for reference) sck (cpol=0) sck (cpol=1) sample input data out (cpha=0) sample input data out (cpha=1) ss (to slave) note: this ?ure shows the lsbf=0 (default) case. if lsbf=1, data is transferred in the reverse order (lsb ?st). tpg 153
motorola 9-4 mc68hc11pa8 serial peripheral interface 9 9.3.1 master in slave out miso is one of two unidirectional serial data signals. it is an input to a master device and an output from a slave device. the miso line of a slave device is placed in the high-impedance state if the slave device is not selected. 9.3.2 master out slave in the mosi line is the second of the two unidirectional serial data signals. it is an output from a master device and an input to a slave device. the master device places data on the mosi line a half-cycle before the clock edge that the slave device uses to latch the data. 9.3.3 serial clock sck, an input to a slave device, is generated by the master device and synchronizes data movement in and out of the device through the mosi and miso lines. master and slave devices are capable of exchanging a byte of information during a sequence of eight clock cycles. there are four possible timing relationships that can be chosen by using control bits cpol and cpha in the serial peripheral control register (spcr). both master and slave devices must operate with the same timing. the spi clock rate select bits of the master device, spr[2:0], select the clock rate. spr[1:0] are found in the spcr register and spr2 is in the opt2 register. in a slave device, spr[2:0] have no effect on the operation of the spi. 9.3.4 slave select the slave select ss input of a slave device must be externally asserted before a master device can exchange data with the slave device. ss must be low before data transactions begin and must stay low for the duration of the transaction. the ss line of the master must be held high. if it goes low, a mode fault error ?g (modf) is set in the serial peripheral status register (spsr). to disable the mode fault circuit, write a one in bit 5 of the port d data direction register. this sets the ss pin to act as a general-purpose output, rather than a dedicated input to the slave select circuit, thus inhibiting the mode fault ?g. the other three lines are dedicated to the spi whenever the serial peripheral interface is on. the state of the master and slave cpha bits affects the operation of ss . cpha settings should be identical for master and slave. when cpha = 0, the shift clock is the or of ss with sck. in this clock phase mode, ss must go high between successive characters in an spi message. when cpha = 1, ss can be left low between successive spi characters. in cases where there is only one spi slave mcu, its ss line can be tied to v ss as long as only cpha = 1 clock mode is used. tpg 154
mc68hc11pa8 motorola 9-5 serial peripheral interface 9 9.4 spi system errors two kinds of system errors can be detected by the spi system. the ?st type of error arises in a multiple-master system when more than one spi device simultaneously tries to be a master. this error is called a mode fault. the second type of error, write collision, indicates that an attempt was made to write data to the spdr while a transfer was in progress. when the spi system is con?ured as a master and the ss input line goes to active low, a mode fault error has occurred ?usually because two devices have attempted to act as master at the same time. in the case where more than one device is concurrently con?ured as a master, there is a chance of contention between two pin drivers. for push-pull cmos drivers, this contention can cause permanent damage. the mode fault detection circuitry attempts to protect the device by disabling the drivers. the mstr control bit in the spcr and all four ddrd control bits associated with the spi are cleared and an interrupt is generated (subject to masking by the spie control bit and the i bit in the ccr). other precautions may need to be taken to prevent driver damage. if two devices are made masters at the same time, the mode fault detector does not help protect either one unless one of them selects the other as slave. the amount of damage possible depends on the length of time both devices attempt to act as master. a write collision error occurs if the spdr is written while a transfer is in progress. because the spdr is not double buffered in the transmit direction, writes to spdr cause data to be written directly into the spi shift register. because this write corrupts any transfer in progress, a write collision error is generated. the transfer continues undisturbed, and the write data that caused the error is not written to the shifter. a write collision is normally a slave error because a slave has no control over when a master initiates a transfer. a master knows when a transfer is in progress, so there is no reason for a master to generate a write-collision error, although the spi logic can detect write collisions in both master and slave devices. the spi con?uration determines the characteristics of a transfer in progress. for a master, a transfer begins when data is written to spdr and ends when spif is set. for a slave with cpha equal to zero, a transfer starts when ss goes low and ends when ss returns high. in this case, spif is set at the middle of the eighth sck cycle when data is transferred from the shifter to the parallel data register, but the transfer is still in progress until ss goes high. for a slave with cpha equal to one, transfer begins when the sck line goes to its active level, which is the edge at the beginning of the ?st sck cycle. the transfer ends when spif is set, for a slave in which cpha=1. 9.5 spi registers the three spi registers, spcr, spsr, and spdr, provide control, status, and data storage functions. refer to the following information for a description of how these registers are organized. tpg 155
motorola 9-6 mc68hc11pa8 serial peripheral interface 9 9.5.1 spcr ?spi control register this register can be read at any time. it can be written at any time except when the mbsp bit in the config register is set, upon which the spcr bits are forced into their reset state and the spi is disabled. spie ?serial peripheral interrupt enable 1 (set) a hardware interrupt sequence is requested each time spif or modf is set. 0 (clear) spi interrupts are inhibited. set the spie bit to a one to request a hardware interrupt sequence each time the spif or modf status ?g is set. spi interrupts are inhibited if this bit is clear or if the i bit in the condition code register is one. spe ?serial peripheral system enable 1 (set) port d [5:2] is dedicated to the spi. 0 (clear) port d has its default i/o functions and the clock generator is stopped. when the spe bit is set, the port d pins 2, 3, 4, and 5 are dedicated to the spi functions and lose their general purpose i/o functions. when the spi system is enabled and expects any of pd[4:2] to be inputs then those pins will be inputs regardless of the state of the associated ddrd bits. if any of pd[4:2] are expected to be outputs then those pins will be outputs only if the associated ddrd bits are set. however, if the spi is in the master mode, ddd5 determines whether pd5 is an error detect input (ddd5 = 0) or a general-purpose output (ddd5 = 1). dwom ?port d wired-or mode 1 (set) port d [5:2] buffers con?ured for open-drain outputs. 0 (clear) port d [5:2] buffers con?ured for normal cmos outputs. mstr ?master mode select 1 (set) master mode 0 (clear) slave mode address bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 state on reset spi control (spcr) $0028 spie spe dwom mstr cpol cpha spr1 spr0 0000 01uu tpg 156
mc68hc11pa8 motorola 9-7 serial peripheral interface 9 cpol ?clock polarity 1 (set) sck is active low. 0 (clear) sck is active high. when the clock polarity bit is cleared and data is not being transferred, the sck pin of the master device has a steady state low value. when cpol is set, sck idles high. refer to figure 9-2 and section 9.2.1. cpha ?clock phase the clock phase bit, in conjunction with the cpol bit, controls the clock-data relationship between master and slave. the cpha bit selects one of two different clocking protocols. refer to figure 9-2 and section 9.2.1. spr1 and spr0 ?spi clock rate selects these two bits select the spi clock rate, as shown in table 9-1. note that spr2 is located in the opt2 register, and that its state on reset is zero. table 9-1 spi clock rates spr[2:0] e clock divide ratio spi clock frequency ( o baud rate) for: e = 2mhz e = 3mhz e = 4mhz 0 0 0 2 1.0 mhz 1.5 mhz 2.0 mhz 0 0 1 4 500 khz 750khz 1.0 mhz 0 1 0 16 125 khz 187.5 khz 250 khz 0 1 1 32 62.5 khz 93.7 khz 125 khz 1 0 0 8 250 khz 375 khz 500 khz 1 0 1 16 125 khz 187.5 khz 250 khz 1 1 0 64 31.3 khz 46.9 khz 62.5 khz 1 1 1 128 15.6 khz 23.4 khz 31.3 khz tpg 157
motorola 9-8 mc68hc11pa8 serial peripheral interface 9 9.5.2 spsr ?spi status register this register can be read at any time, but writing to it has no effect. spif ?spi interrupt complete ?g 1 (set) data transfer to external device has been completed. 0 (clear) no valid completion of data transfer. spif is set upon completion of data transfer between the processor and the external device. if spif goes high, and if spie is set, a serial peripheral interrupt is generated. to clear the spif bit, read the spsr with spif set, then access the spdr. unless spsr is read (with spif set) ?st, attempts to write spdr are inhibited. wcol ?write collision 1 (set) write collision. 0 (clear) no write collision. clearing the wcol bit is accomplished by reading the spsr (with wcol set) followed by an access of spdr. refer to section 9.3.4 and section 9.4. modf ?mode fault 1 (set) mode fault. 0 (clear) no mode fault. to clear the modf bit, read the spsr (with modf set), then write to the spcr. refer to section 9.3.4 and section 9.4. bits [5, 3, 2] ? not implemented; always read zero. xpin ?xirq pin input data bit (refer to section 6.8) ipin ?irq pin input data bit (refer to section 6.8) address bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 state on reset spi status (spsr) $0029 spif wcol 0 modf 0 0 xpin ipin 0000 00uu tpg 158
mc68hc11pa8 motorola 9-9 serial peripheral interface 9 9.5.3 spdr ?spi data register the spdr is used when transmitting or receiving data on the serial bus. only a write to this register initiates transmission or reception of a byte, and this only occurs in the master device. at the completion of transferring a byte of data, the spif status bit is set in both the master and slave devices. a read of the spdr is actually a read of a buffer. to prevent an overrun and the loss of the byte that caused the overrun, the ?st spif must be cleared by the time a second transfer of data from the shift register to the read buffer is initiated. spi is double buffered in and single buffered out. 9.5.4 opt2 ?system con?uration options register 2 lirdv ?lir driven (refer to section 4) 1 (set) enable lir drive high pulse. 0 (clear) lir not driven on moda/lir pin. cwom ?port c wired-or mode (refer to section 6) 1 (set) port c outputs are open-drain. 0 (clear) port c operates normally. strch ?stretch external accesses (refer to section 4) 1 (set) off-chip accesses are extended by one e clock cycle. 0 (clear) normal operation. address bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 state on reset spi data (spdr) $002a (bit 7) (6) (5) (4) (3) (2) (1) (bit 0) unde?ed address bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 state on reset system con?. options 2 (opt2) $0038 lirdv cwom strch irvne lsbf spr2 ext4x xirqe x00x 0000 tpg 159
motorola 9-10 mc68hc11pa8 serial peripheral interface 9 irvne ?internal read visibility/not e (refer to section 4) 1 (set) data from internal reads is driven out of the external data bus. 0 (clear) no visibility of internal reads on external bus. in single chip mode this bit determines whether the e clock drives out from the chip. 1 (set) e pin is driven low. 0 (clear) e clock is driven out from the chip. lsbf ?lsb ?st enable 1 (set) spi data is transferred lsb ?st. 0 (clear) spi data is transferred msb ?st. if this bit is set, data, which is usually transferred msb ?st, is transferred lsb ?st. lsbf does not affect the position of the msb and lsb in the data register. reads and writes of the data register always have msb in bit 7. spr2 ?spi clock rate select when set, spr2 adds a divide-by-4 prescaler to the spi clock chain. with the two bits in the spcr, this bit speci?s the spi clock rate. refer to table 9-1. ext4x ?xout clock output select (refer to section 4) 1 (set) extali clock is output on the xout pin. 0 (clear) 4xclk clock is output on the xout pin. note: the xout pin is not available on 64-pin qfp packaged devices; see section 4 xirqe ?con?ure xirq for falling-edge-sensitive operation (see section 4.3.2.5) 1 (set) falling-edge-sensitive operation. 0 (clear) low-level-sensitive operation. tpg 160
mc68hc11pa8 motorola 10-1 timing system 10 10 timing system the m68hc11 timing system is composed of several clock divider chains. the main clock divider chain includes a 16-bit free-running counter, which is driven by a programmable prescaler. the main timers programmable prescaler provides one of the four clocking rates to drive the 16-bit counter. two prescaler control bits select the prescale rate. the prescaler output divides the system clock by 1, 4, 8, or 16. taps from this main clocking chain drive circuitry are used to generate the slower clocks used by the pulse accumulator, the real-time interrupt (rti), and computer operating properly (cop) watchdog subsystems. refer to figure 10-1. 10.1 timer operation all main timer system activities are referenced to the free-running counter. the counter begins incrementing from $0000 as the mcu comes out of reset, and continues to the maximum count, $ffff. at the maximum count, the counter rolls over to $0000, sets an over?w ?g and continues to increment. as long as the mcu is running in a normal operating mode, there is no way to reset, change or interrupt the counting. the capture/compare subsystem features three input capture channels, four output compare channels and one channel that can be selected to perform either input capture or output compare. each of the input capture functions has its own 16-bit input capture register (time capture latch) and each of the output compare functions has its own 16-bit compare register. all timer functions, including the timer over?w and rti, have their own interrupt controls and separate interrupt vectors. see table 10-1 for related frequencies and periods. clocks for the pulse accumulator, real time interrupt and cop functions are derived from the internal st4xck signal. if the pll circuit is active (vddsyn = 1) and the mcs and bcs bits in pllcr are both set, then st4xck is equal to the output of the pll circuit, vcoout. otherwise, st4xck is the same as extali. refer to figure 10-1 and section 2. the pulse accumulator contains an 8-bit counter and edge select logic. the pulse accumulator can operate in either event counting mode or gated time accumulation mode. during event counting mode, the pulse accumulators 8-bit counter increments when a speci?d edge is detected on an input pin. during gated time accumulation mode, an internal clock source (st4xck/2 8 ) increments the 8-bit counter while an input signal has a predetermined logic level. see section 10.1.6. tpg 161
motorola 10-2 mc68hc11pa8 timing system 10 the real-time interrupt (rti) is a programmable periodic interrupt circuit that permits pacing of the execution of software routines by selecting one of four interrupt rates. it is clocked by the 16-bit timer (st4xck/2 15 ); see section 10.1.4. the cop watchdog clock input is tapped off from the free-running counter chain (st4xck/2 17 ); see section 10.1.5. the cop automatically times out unless it is serviced within a speci? time by a program reset sequence. if the cop is allowed to time out, a reset is generated, which drives the reset pin low to reset the mcu and the external system (see section 5). (1) crystal frequencies are valid only if the pll is not active. table 10-1 timer resolution and capacity clock 4.0mhz 8.0mhz 12.0mhz 16.0mhz st4xck crystal (1) control bits pr[1:0] 1.0mhz 2.0mhz 3.0mhz 4.0mhz st4xck/4 clock 1000ns 500ns 333ns 250ns 4/st4xck period 0 0 1.0 m s 65.536ms 500ns 32.768ms 333ns 21.845ms 250ns 16.384ms 4/st4xck 2 18 /st4xck ?resolution ?over?w 0 1 4.0 m s 262.14ms 2.0 m s 131.07ms 1.333 m s 87.381ms 1.0 m s 65.536ms 16/st4xck 2 20 /st4xck ?resolution ?over?w 1 0 8.0 m s 524.29ms 4.0 m s 262.14ms 2.667 m s 174.76ms 2.0 m s 131.07ms 32/st4xck 2 21 /st4xck ?resolution ?over?w 1 1 16.0 m s 1049 ms 8.0 m s 524.29ms 5.333 m s 349.53ms 4.0 m s 262.14ms 64/st4xck 2 22 /st4xck ?resolution ?over?w tpg 162
mc68hc11pa8 motorola 10-3 timing system 10 figure 10-1 timer clock divider chains ? 2 6 set q q reset ff2 set q q reset ff1 + baud ? 1, 2, 3, 4,? 8191 sci receiver clock sci transmitter clock e clock prescaler ? 2, 4, 8,16, 32, 64, 128 spr[2:0] spi pulse accumulator prescaler ? 1, 2, 4, 8 rtr[1:0] real time interrupt tcnt tof prescaler ? 1, 4, 16, 64 cr[1:0] system reset clear cop timer force cop reset ic/oc ? 4 ? 16 internal bus clock crystal oscillator pll bus clock select module clock select ? 2 ? 4 ph2 (for cpu, a/d prescaler ? 1, 4, 8, 16 pr[1:0] bcs mcs st4xck 4xclk extali 1 0 1 0 sbr[12:0] and memory) ? 4 (baud rate) note: if the pll system is not active, then mcs and bcs have no meaning, and all system clocks are referenced to extali. ? 2 13 tpg 163
motorola 10-4 mc68hc11pa8 timing system 10 10.1.1 timer structure the timer functions share i/o with all eight pins of port a: figure 10-2 shows the capture/compare system block diagram. the port a pin control block includes logic for timer functions and for general-purpose i/o. for pins pa3, pa2, pa1 and pa0, this block contains both the edge-detection logic and the control logic that enables the selection of which edge triggers an input capture. the digital level on pa[3:0] can be read at any time (read porta register), even if the pin is being used for the input capture function. pins pa[6:3] are used either for general-purpose i/o, or as output compare pins. when one of these pins is being used for an output compare function, it cannot be written directly as if it were a general-purpose output. each of the output compare functions (oc[5:2]) is related to one of the port a output pins. output compare 1 (oc1) has extra control logic, allowing it optional control of any combination of the pa[7:3] pins. the pa7 pin can be used as a general-purpose i/o pin, as an input to the pulse accumulator or as an oc1 output pin. pin alternative function pa0 ic3 pa1 ic2 pa2 ic1 pa3 oc5 and/or oc1, or ic4 pa4 oc4 and/or oc1 pa5 oc3 and/or oc1 pa6 oc2 and/or oc1 pa7 pai and/or oc1 tpg 164
mc68hc11pa8 motorola 10-5 timing system 10 figure 10-2 capture/compare block diagram + & prescaler ? 1, 4, 8, 16 pr[1:0] st4xck/4 16-bit free running counter tcnt (hi) tcnt (lo) toc1 (lo) & 9 toc1 (hi) 16-bit comparator eq toc2 (lo) toc2 (hi) 16-bit comparator eq toc3 (lo) toc3 (hi) 16-bit comparator eq toc4 (lo) toc4 (hi) 16-bit comparator eq ti4/o5 (lo) ti4/o5 (hi) 16-bit comparator eq tic1 (lo) tic1 (hi) tic2 (lo) tic2 (hi) tic3 (lo) tic3 (hi) 16-bit timer bus 16-bit latch clk 16-bit latch clk 16-bit latch clk 16-bit latch clk oc1f tof toi i4/o5f 8 oc2f oc3f oc4f ic1f ic2f ic3f i4/o5 oc5 ic4 oc1i foc1 bit 7 + & 7 oc2i foc2 + & 6 oc3i foc3 + & 5 oc4i foc4 + & 4 i4/o5i foc5 & ic1i 3 & ic3i 1 & ic2i 2 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 pa6/ oc2/ oc1 pa5/ oc3/ oc1 pa4/ oc4/ oc1 pa3/ oc5/ oc1/ pa2/ ic1 ic4 pa1/ ic2 pa0/ ic3 tflg1 status ?gs tmsk1 interrupt enables port a pin control ?port a pin actions are controlled by oc1m, oc1d, pactl, tctl1 and tctl2 registers pins/ functions cforc force o/p compare to pulse accumulator note ? ? interrupt requests 1? (these are further quali?d by the i-bit in the ccr) pa7/ oc1/ pai tpg 165
motorola 10-6 mc68hc11pa8 timing system 10 10.1.2 input capture the input capture function records the time an external event occurs by latching the value of the free-running counter when a selected edge is detected at the associated timer input pin. software can store latched values and use them to compute the periodicity and duration of events. for example, by storing the times of successive edges of an incoming signal, software can determine the period and pulse width of a signal. to measure period, two successive edges of the same polarity are captured. to measure pulse width, two alternate polarity edges are captured. in most cases, input capture edges are asynchronous with respect to the internal timer counter, which is clocked relative to an internal clock (ph2). these asynchronous capture requests are synchronized with ph2 so that latching occurs on the opposite half cycle of ph2 from when the timer counter is being incremented. this synchronization process introduces a delay from when the edge occurs to when the counter value is detected. because these delays cancel out when the time between two edges is being measured, the delay can be ignored. when an input capture is being used with an output compare, there is a similar delay between the actual compare point and when the output pin changes state. the control and status bits that implement the input capture functions are contained in the pactl, tctl2, tmsk1, and tflg1 registers. to con?ure port a bit 3 as an input capture, clear the dda3 bit of the ddra register. note that this bit is cleared out of reset. to enable pa3 as the fourth input capture, set the i4/o5 bit in the pactl register. otherwise, pa3 is con?ured as a ?th output compare out of reset, with bit i4/o5 being cleared. if the dda3 bit is set (con?uring pa3 as an output), and ic4 is enabled, then writes to pa3 cause edges on the pin to result in input captures. writing to ti4/o5 has no effect when the ti4/o5 register is acting as ic4. tpg 166
mc68hc11pa8 motorola 10-7 timing system 10 10.1.2.1 tctl2 ?timer control register 2 use the control bits of this register to program input capture functions to detect a particular edge polarity on the corresponding timer input pin. each of the input capture functions can be independently con?ured to detect rising edges only, falling edges only, any edge (rising or falling), or to disable the input capture function. the input capture functions operate independently of each other and can capture the same tcnt value if the input edges are detected within the same timer count cycle. edgxb and edgxa ?input capture edge control there are four pairs of these bits. each pair is cleared by reset and must be encoded to con?ure the corresponding input capture edge detector circuit. ic4 functions only if the i4/o5 bit in the pactl register is set. address bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 state on reset timer control 2 (tctl2) $0021 edg4b edg4a edg1b edg1a edg2b edg2a edg3b edg3a 0000 0000 edgxb edgxa con?uration 0 0 icx disabled 0 1 icx captures on rising edges only 1 0 icx captures on falling edges only 1 1 icx captures on any edge tpg 167
motorola 10-8 mc68hc11pa8 timing system 10 10.1.2.2 tic1?ic3 ?timer input capture registers when an edge has been detected and synchronized, the 16-bit free-running counter value is transferred into the input capture register pair as a single 16-bit parallel transfer. timer counter value captures and timer counter incrementing occur on opposite half-cycles of the phase 2 clock so that the count value is stable whenever a capture occurs. input capture values can be read from a pair of 8-bit read-only registers. a read of the high-order byte of an input capture register pair inhibits a new capture transfer for one bus cycle. if a double-byte read instruction, such as ldd, is used to read the captured value, coherency is assured. when a new input capture occurs immediately after a high-order byte read, transfer is delayed for an additional cycle but the value is not lost. the ticx registers are not affected by reset. 10.1.2.3 ti4/o5 ?timer input capture 4/output compare 5 register use ti4/o5 as either an input capture register or an output compare register, depending on the function chosen for the pa3 pin. to enable it as an input capture pin, set the i4/o5 bit in the pulse accumulator control register (pactl) to logic level one. to use it as an output compare register, set the i4/o5 bit to a logic level zero. refer to section 10.1.6.1. the ti4/o5 register pair resets to ones ($ffff). address bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 state on reset timer input capture 1 (tic1) high $0010 (bit 15) (14) (13) (12) (11) (10) (9) (bit 8) unde?ed timer input capture 1 (tic1) low $0011 (bit 7) (6) (5) (4) (3) (2) (1) (bit 0) unde?ed timer input capture 2 (tic2) high $0012 (bit 15) (14) (13) (12) (11) (10) (9) (bit 8) unde?ed timer input capture 2 (tic2) low $0013 (bit 7) (6) (5) (4) (3) (2) (1) (bit 0) unde?ed timer input capture 3 (tic3) high $0014 (bit 15) (14) (13) (12) (11) (10) (9) (bit 8) unde?ed timer input capture 3 (tic3) low $0015 (bit 7) (6) (5) (4) (3) (2) (1) (bit 0) unde?ed address bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 state on reset capture 4/compare 5 (ti4/o5) high $001e (bit 15) (14) (13) (12) (11) (10) (9) (bit 8) 1111 1111 capture 4/compare 5 (ti4/o5) low $001f (bit 7) (6) (5) (4) (3) (2) (1) (bit 0) 1111 1111 tpg 168
mc68hc11pa8 motorola 10-9 timing system 10 10.1.3 output compare use the output compare (oc) function to program an action to occur at a speci? time ?when the 16-bit counter reaches a speci?d value. for each of the ?e output compare functions, there is a separate 16-bit compare register and a dedicated 16-bit comparator. the value in the compare register is compared to the value of the free-running counter on every bus cycle. when the compare register matches the counter value, an output compare status ?g is set. the ?g can be used to initiate the automatic actions for that output compare function. to produce a pulse of a speci? duration, write a value to the output compare register that represents the time the leading edge of the pulse is to occur. the output compare circuit is con?ured to set the appropriate output either high or low, depending on the polarity of the pulse being produced. after a match occurs, the output compare register is reprogrammed to change the output pin back to its inactive level at the next match. a value representing the width of the pulse is added to the original value, and then written to the output compare register. because the pin state changes occur at speci? values of the free-running counter, the pulse width can be controlled accurately at the resolution of the free-running counter, independent of software latency. to generate an output signal of a speci? frequency and duty cycle, repeat this pulse-generating procedure. there are four 16-bit read/write output compare registers: toc1, toc2, toc3, and toc4, and the ti4/o5 register, which functions under software control as either ic4 or oc5. each of the oc registers is set to $ffff on reset. a value written to an oc register is compared to the free-running counter value during each e clock cycle. if a match is found, the particular output compare ?g is set in timer interrupt ?g register 1 (tflg1). if that particular interrupt is enabled in the timer interrupt mask register 1 (tmsk1), an interrupt is generated. in addition to an interrupt, a speci?d action can be initiated at one or more timer output pins. for oc[5:2], the pin action is controlled by pairs of bits (omx and olx) in the tctl1 register. the output action is taken on each successful compare, regardless of whether or not the ocxf ?g in the tflg1 register was previously cleared. oc1 is different from the other output compares in that a successful oc1 compare can affect any or all ?e of the oc pins. the oc1 output action taken when a match is found is controlled by two 8-bit registers with three bits unimplemented: the output compare 1 mask register, oc1m, and the output compare 1 data register, oc1d. oc1m speci?s which port a outputs are to be used, and oc1d speci?s what data is placed on these port pins. tpg 169
motorola 10-10 mc68hc11pa8 timing system 10 10.1.3.1 toc1?oc4 ?timer output compare registers all output compare registers are 16-bit read-write. each is initialized to $ffff at reset. if an output compare register is not used for an output compare function, it can be used as a storage location. a write to the high-order byte of an output compare register pair inhibits the output compare function for one bus cycle. this inhibition prevents inappropriate subsequent comparisons. coherency requires a complete 16-bit read or write. however, if coherency is not needed, byte accesses can be used. for output compare functions, write a comparison value to output compare registers toc1?oc4 and ti4/o5. when tcnt value matches the comparison value, speci?d pin actions occur. all tocx register pairs reset to ones ($ffff). 10.1.3.2 cforc ?timer compare force register the cforc register allows forced early compares. foc[1:5] correspond to the ?e output compares. these bits are set for each output compare that is to be forced. the action taken as a result of a forced compare is the same as if there were a match between the ocx register and the free-running counter, except that the corresponding interrupt status ?g bits are not set. the forced channels trigger their programmed pin actions to occur at the next timer count transition after the write to cforc. the cforc bits should not be used on an output compare function that is programmed to toggle its output on a successful compare because a normal compare that occurs immediately before or after the force can result in an undesirable operation. address bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 state on reset timer output compare 1 (toc1) high $0016 (bit 15) (14) (13) (12) (11) (10) (9) (bit 8) 1111 1111 timer output compare 1 (toc1) low $0017 (bit 7) (6) (5) (4) (3) (2) (1) (bit 0) 1111 1111 timer output compare 2 (toc2) high $0018 (bit 15) (14) (13) (12) (11) (10) (9) (bit 8) 1111 1111 timer output compare 2 (toc2) low $0019 (bit 7) (6) (5) (4) (3) (2) (1) (bit 0) 1111 1111 timer output compare 3 (toc3) high $001a (bit 15) (14) (13) (12) (11) (10) (9) (bit 8) 1111 1111 timer output compare 3 (toc3) low $001b (bit 7) (6) (5) (4) (3) (2) (1) (bit 0) 1111 1111 timer output compare 4 (toc4) high $001c (bit 15) (14) (13) (12) (11) (10) (9) (bit 8) 1111 1111 timer output compare 4 (toc4) low $001d (bit 7) (6) (5) (4) (3) (2) (1) (bit 0) 1111 1111 address bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 state on reset timer compare force (cforc) $000b foc1 foc2 foc3 foc4 foc5 0 0 0 0000 0000 tpg 170
mc68hc11pa8 motorola 10-11 timing system 10 foc[1:5] ?force output compares 1 (set) a forced output compare action will occur on the speci?d pin. 0 (clear) no action. bits [2:0] ?not implemented; always read zero 10.1.3.3 oc1m ?output compare 1 mask register use oc1m with oc1 to specify the bits of port a that are affected by a successful oc1 compare. the bits of the oc1m register correspond to pa7?a3. oc1m[7:3] ?output compare masks for oc1 1 (set) oc1 is con?ured to control the corresponding pin of port a. 0 (clear) oc1 will not affect the corresponding port a pin. bits [2:0] ?not implemented; always read zero. 10.1.3.4 oc1d ?output compare 1 data register use this register with oc1 to specify the data that is to be written to the affected pin of port a after a successful oc1 compare. when a successful oc1 compare occurs, a data bit in oc1d is written to the corresponding pin of port a for each bit that is set in oc1m. oc1d[7:3] ?output compare data for oc1 if oc1mx is set, data in oc1dx is output to port a pin x on successful oc1 compares. bits [2:0] ?not implemented; always read zero address bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 state on reset output compare 1 mask (oc1m) $000c oc1m7 oc1m6 oc1m5 oc1m4 oc1m3 0 0 0 0000 0000 address bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 state on reset output compare 1 data (oc1d) $000d oc1d7 oc1d6 oc1d5 oc1d4 oc1d3 0 0 0 0000 0000 tpg 171
motorola 10-12 mc68hc11pa8 timing system 10 10.1.3.5 tcnt ?timer counter register the 16-bit read-only tcnt register contains the prescaled value of the 16-bit timer. a full counter read addresses the more signi?ant byte (msb) ?st. a read of this address causes the less signi?ant byte (lsb) to be latched into a buffer for the next cpu cycle so that a double-byte read returns the full 16-bit state of the counter at the time of the msb read cycle. tcnt resets to $0000. 10.1.3.6 tctl1 ?timer control register 1 the bits of this register specify the action taken as a result of a successful ocx compare. om[5:2] ?output mode ol[5:2] ?output level these control bit pairs are encoded to specify the action taken after a successful ocx compare. oc5 functions only if the i4/o5 bit in the pactl register is clear. address bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 state on reset timer count (tcnt) high $000e (bit 15) (14) (13) (12) (11) (10) (9) (bit 8) 0000 0000 timer count (tcnt) low $000f (bit 7) (6) (5) (4) (3) (2) (1) (bit 0) 0000 0000 address bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 state on reset timer control 1 (tctl1) $0020 om2 ol2 om3 ol3 om4 ol4 om5 ol5 0000 0000 omx olx action taken on successful compare 0 0 timer disconnected from ocx pin logic 0 1 toggle ocx output line 1 0 clear ocx output line to 0 1 1 set ocx output line to 1 tpg 172
mc68hc11pa8 motorola 10-13 timing system 10 10.1.3.7 tmsk1 ?timer interrupt mask register 1 use this 8-bit register to enable or inhibit the timer input capture and output compare interrupts. note: bits in tmsk1 correspond bit for bit with ?g bits in tflg1. ones in tmsk1 enable the corresponding interrupt sources. oc1i?c4i ?output compare x interrupt enable 1 (set) ocx interrupt is enabled. 0 (clear) ocx interrupt is disabled. if the ocxi enable bit is set when the ocxf ?g bit is set, a hardware interrupt sequence is requested. i4/o5i ?input capture 4/output compare 5 interrupt enable 1 (set) ic4/oc5 interrupt is enabled. 0 (clear) ic4/oc5 interrupt is disabled. when i4/o5 in pactl is set, i4/o5i is the input capture 4 interrupt enable bit. when i4/o5 in pactl is zero, i4/o5i is the output compare 5 interrupt enable bit. ic1i?c3i ?input capture x interrupt enable 1 (set) icx interrupt is enabled. 0 (clear) icx interrupt is disabled. if the icxi enable bit is set when the icxf ?g bit is set, a hardware interrupt sequence is requested. address bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 state on reset timer interrupt mask 1 (tmsk1) $0022 oc1i oc2i oc3i oc4i i4/o5i ic1i ic2i ic3i 0000 0000 tpg 173
motorola 10-14 mc68hc11pa8 timing system 10 10.1.3.8 tflg1 ?timer interrupt ?g register 1 bits in this register indicate when timer system events have occurred. coupled with the bits of tmsk1, the bits of tflg1 allow the timer subsystem to operate in either a polled or interrupt driven system. clear ?gs by writing a one to the corresponding bit position(s). note: bits in tflg1 correspond bit for bit with ?g bits in tmsk1. ones in tmsk1 enable the corresponding interrupt sources. oc1f?c4f ?output compare x ?g 1 (set) counter has reached the preset output compare x value. 0 (clear) counter has not reached the preset output compare x value. these ?gs are set each time the counter matches the corresponding output compare x values. i4/o5f ?input capture 4/output compare 5 ?g set by ic4 or oc5, depending on the function enabled by i4/o5 bit in pactl ic1f?c3f ?input capture x ?g 1 (set) selected edge has been detected on corresponding port pin. 0 (clear) selected edge has not been detected on corresponding port pin. these ?gs are set each time a selected active edge is detected on the icx input line address bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 state on reset timer interrupt ?g 1 (tflg1) $0023 oc1f oc2f oc3f oc4f i4/o5f ic1f ic2f ic3f 0000 0000 tpg 174
mc68hc11pa8 motorola 10-15 timing system 10 10.1.3.9 tmsk2 ?timer interrupt mask register 2 use this 8-bit register to enable or inhibit timer over?w and real-time interrupts. the timer prescaler control bits are included in this register. note: bits in tmsk2 correspond bit for bit with ?g bits in tflg2. ones in tmsk2 enable the corresponding interrupt sources. toi ?timer over?w interrupt enable 1 (set) timer over?w interrupt requested when tof is set. 0 (clear) tof interrupts disabled. rtii ?real-time interrupt enable (refer to section 10.1.4) 1 (set) real time interrupt requested when rtif is set. 0 (clear) real time interrupts disabled. paovi ?pulse accumulator over?w interrupt enable (refer to section 10.1.6) paii ?pulse accumulator input edge interrupt enable (refer to section 10.1.6) bits [3, 2] ?not implemented; always read zero. pr[1:0] ?timer prescaler select these bits are used to select the prescaler divide-by ratio. in normal modes, pr[1:0] can only be written once, and the write must be within 64 cycles after reset. see table 10-1 for speci? timing values. address bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 state on reset timer interrupt mask 2 (tmsk2) $0024 toi rtii paovi paii 0 0 pr1 pr0 0000 0000 pr[1:0] prescaler 0 0 1 0 1 4 1 0 8 1 1 16 tpg 175
motorola 10-16 mc68hc11pa8 timing system 10 10.1.3.10 tflg2 ?timer interrupt ?g register 2 bits in this register indicate when certain timer system events have occurred. coupled with the four high-order bits of tmsk2, the bits of tflg2 allow the timer subsystem to operate in either a polled or interrupt driven system. clear ?gs by writing a one to the corresponding bit position(s). note: bits in tflg2 correspond bit for bit with ?g bits in tmsk2. ones in tmsk2 enable the corresponding interrupt sources. tof ?timer over?w interrupt ?g 1 (set) tcnt has over?wed from $ffff to $0000. 0 (clear) no timer over?w has occurred. rtif ?real time (periodic) interrupt ?g (refer to section 10.1.4) 1 (set) rti period has elapsed. 0 (clear) rti ?g has been cleared. paovf ?pulse accumulator over?w interrupt ?g (refer to section 10.1.6) paif ?pulse accumulator input edge interrupt ?g (refer to section 10.1.6.) bits [3:0] ?not implemented; always read zero address bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 state on reset timer interrupt ?g 2 (tflg2) $0025 tof rtif paovf paif0000 0000 0000 tpg 176
mc68hc11pa8 motorola 10-17 timing system 10 10.1.4 real-time interrupt the real-time interrupt (rti) feature, used to generate hardware interrupts at a ?ed periodic rate, is clocked by the 16-bit free-running counter (st4xck/2 15 ). see figure 10-1. the rti clock rate is con?ured by the rtr1 and rtr0 bits in the pulse accumulator control register, pactl. the different rates available are a product of the source frequency and the value of bits rtr[1:0]. the source frequency, st4xck/2 15 , can be divided by 1, 2, 4 or 8. refer to table 10-2 which shows examples of periodic real-time interrupt rates. the rtii bit in the tmsk2 register enables the interrupt capability. the clock source for the rti function is free-running clock that cannot be stopped or interrupted except by reset. this causes the time between successive rti timeouts to be a constant that is independent of the software latency associated with ?g clearing and service. for this reason, an rti period starts from the previous timeout, not from when rtif is cleared. every timeout causes the rtif bit in tflg2 to be set, and if rtii is set, an interrupt request is generated. after reset, one entire rti period elapses before the rtif ?g is set for the ?st time. refer to the tmsk2, tflg2, and pactl registers. 10.1.4.1 tmsk2 ?timer interrupt mask register 2 this register contains the real-time interrupt enable bit. note: bits in tmsk2 correspond bit for bit with ?g bits in tflg2. ones in tmsk2 enable the corresponding interrupt sources. toi ?timer over?w interrupt enable (refer to section 10.1.3.9) 1 (set) timer over?w interrupt requested when tof is set. 0 (clear) tof interrupts disabled. table 10-2 rti periodic rates rtr[1:0] st4xck = 16mhz st4xck = 8mhz st4xck = 4mhz st4xck = xmhz 0 0 0 1 1 0 1 1 2.048ms 4.096ms 8.192ms 16.384 ms 4.096ms 8.192ms 16.384ms 32.768ms 8.192ms 16.384ms 32.768ms 65.536ms 2 15 /st4xck 2 16 /st4xck 2 17 /st4xck 2 18 /st4xck address bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 state on reset timer interrupt mask 2 (tmsk2) $0024 toi rtii paovi paii 0 0 pr1 pr0 0000 0000 tpg 177
motorola 10-18 mc68hc11pa8 timing system 10 rtii ?real-time interrupt enable 1 (set) real time interrupt requested when rtif is set. 0 (clear) real time interrupts disabled. paovi ?pulse accumulator over?w interrupt enable (refer to section 10.1.6) paii ?pulse accumulator input edge (refer to section 10.1.6) bits[3, 2] ?not implemented; always reads zero pr[1, 0] ?timer prescaler select (refer to section 10.1.3.9) 10.1.4.2 tflg2 ?timer interrupt ?g register 2 bits of this register indicate the occurrence of timer system events. coupled with the four high-order bits of tmsk2, the bits of tflg2 allow the timer subsystem to operate in either a polled or interrupt driven system. clear ?gs by writing a one to the corresponding bit position(s). note: bits in tflg2 correspond bit for bit with ?g bits in tmsk2. ones in tmsk2 enable the corresponding interrupt sources. tof ?timer over?w interrupt ?g (refer to section 10.1.3.10) 1 (set) tcnt has over?wed from $ffff to $0000. 0 (clear) no timer over?w has occurred. rtif ?real-time interrupt ?g 1 (set) rti period has elapsed. 0 (clear) rti ?g has been cleared. the rtif status bit is automatically set at the end of every rti period. paovf ?pulse accumulator over?w interrupt ?g (refer to section 10.1.6) paif ?pulse accumulator input edge interrupt ?g (refer to section 10.1.6) bits [3:0] ?not implemented; always read zero address bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 state on reset timer interrupt ?g 2 (tflg2) $0025 tof rtif paovf paif0000 0000 0000 tpg 178
mc68hc11pa8 motorola 10-19 timing system 10 10.1.4.3 pactl ?pulse accumulator control register the rtr[1:0] bits in this register select the rate for the rti system. the remaining bits control the pulse accumulator and ic4/oc5 functions. bits [7, 3] ?not implemented; always read zero paen ?pulse accumulator system enable (refer to section 10.1.6) 1 (set) pulse accumulator enabled. 0 (clear) pulse accumulator disabled. pamod ?pulse accumulator mode (refer to section 10.1.6) 1 (set) gated time accumulation mode. 0 (clear) event counter mode. pedge ?pulse accumulator edge control (refer to section 10.1.6) this bit has different meanings depending on the state of the pamod bit. i4/o5 ?input capture 4/output compare 5 (refer to section 10.1.6) 1 (set) input capture 4 function is enabled (no oc5). 0 (clear) output compare 5 function is enabled (no ic4). rtr[1:0] ?rti interrupt rate select these two bits determine the rate at which the rti system requests interrupts. the rti system is driven by the st4xck/2 15 clock rate that is compensated so it is independent of the timer prescaler. these two control bits select an additional division factor. refer to table 10-2. address bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 state on reset pulse accumulator control (pactl) $0026 0 paen pamod pedge 0 i4/o5 rtr1 rtr0 0000 0000 tpg 179
motorola 10-20 mc68hc11pa8 timing system 10 10.1.5 computer operating properly watchdog function the clocking chain for the cop function is tapped off from the main timer divider chain (st4xck/2 17 ). the cr[1:0] bits in the option register and the nocop bit in the config register control and con?ure the cop function. one additional register, coprst, is used to arm and clear the cop watchdog reset system. refer to section 5 for a more detailed discussion of the cop function. 10.1.6 pulse accumulator the mc68hc11pa8/mc68hc11pb8 has an 8-bit counter that can be con?ured to operate either as a simple event counter, or for gated time accumulation, depending on the state of the pamod bit in the pactl register. refer to the pulse accumulator block diagram, figure 10-3. in the event counting mode, the 8-bit counter is clocked to increasing values by an external pin. the maximum clocking rate for the external event counting mode is the e clock divided by two. in gated time accumulation mode, a free-running st4xck/2 8 signal drives the 8-bit counter, but only while the external pai pin is activated. refer to table 10-3. the pulse accumulator counter can be read or written at any time. table 10-3 pulse accumulator timing st4xck st4xck/4 clock cycle time 2 8 /st4xck pacnt over?w 4.0 mhz 1.0 mhz 1000 ns 64 m s 16.384 ms 8.0 mhz 2.0 mhz 500 ns 32 m s 8.192 ms 12.0 mhz 3.0 mhz 333 ns 21.33 m s 5.461 ms 16.0 mhz 4.0 mhz 250 ns 16.0 m s 4.096 ms tpg 180
mc68hc11pa8 motorola 10-21 timing system 10 pulse accumulator control bits are located within the pactl, tmsk2 and tflg2 registers, as described in the following paragraphs. figure 10-3 pulse accumulator block diagram tof 0 paovf paif 0 0 0 tflg2 rtif toi rtii 0 paii 0 pr1 pr0 tmsk2 0 paen 0 pamod pactl paovi rtr1 rtr0 pedge i4/o5 & & pacnt 1 2 pa7/ oc1/ pai 2:1 mux input buffer and edge detector output buffer & from ddra7 from oc1 st4xck/2 8 clock (from main timer) over?w enable clock interrupt requests internal data bus disable ?g setting tpg 181
motorola 10-22 mc68hc11pa8 timing system 10 10.1.6.1 pactl ?pulse accumulator control register four of this registers bits control an 8-bit pulse accumulator system. another bit enables either the oc5 function or the ic4 function, while two other bits select the rate for the real-time interrupt system. bits [7, 3] ?not implemented; always read zero paen ?pulse accumulator system enable 1 (set) pulse accumulator enabled. 0 (clear) pulse accumulator disabled. pamod ?pulse accumulator mode 1 (set) gated time accumulation mode. 0 (clear) event counter mode. pedge ?pulse accumulator edge control this bit has different meanings depending on the state of the pamod bit, as shown: i4/o5 ?input capture 4/output compare 5 1 (set) input capture 4 function is enabled (no oc5). 0 (clear) output compare 5 function is enabled (no ic4) rtr[1:0] ?rti interrupt rate selects (refer to section 10.1.4) address bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 state on reset pulse accumulator control (pactl) $0026 0 paen pamod pedge 0 i4/o5 rtr1 rtr0 0000 0000 pamod pedge action of clock 0 0 pai falling edge increments the counter. 0 1 pai rising edge increments the counter. 1 0 a zero on pai inhibits counting. 1 1 a one on pai inhibits counting. tpg 182
mc68hc11pa8 motorola 10-23 timing system 10 10.1.6.2 pacnt ?pulse accumulator count register this 8-bit read/write register contains the count of external input events at the pai input, or the accumulated count. in gated time accumulation mode, pacnt is readable even if pai is not active. the counter is not affected by reset and can be read or written at any time. counting is synchronized to the internal ph2 clock so that incrementing and reading occur during opposite half cycles. 10.1.6.3 pulse accumulator status and interrupt bits the pulse accumulator control bits, paovi and paii, paovf and paif are located within timer registers tmsk2 and tflg2. 10.1.6.4 tmsk2 ?timer interrupt mask 2 register 10.1.6.5 tflg2 ?timer interrupt ?g 2 register paovi and paovf ?pulse accumulator interrupt enable and over?w ?g the paovf status bit is set each time the pulse accumulator count rolls over from $ff to $00. to clear this status bit, write a one in the corresponding data bit position (bit 5) of the tflg2 register. the paovi control bit allows the pulse accumulator over?w to be con?ured for polled or interrupt-driven operation and does not affect the state of paovf. when paovi is zero, pulse accumulator over?w interrupts are inhibited, and the system operates in a polled mode, which requires that paovf be polled by user software to determine when an over?w has occurred. when the paovi control bit is set, a hardware interrupt request is generated each time paovf is set. before leaving the interrupt service routine, software must clear paovf. address bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 state on reset pulse accumulator count (pacnt) $0027 (bit 7) (6) (5) (4) (3) (2) (1) (bit 0) unde?ed address bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 state on reset timer interrupt mask 2 (tmsk2) $0024 toi rtii paovi paii 0 0 pr1 pr0 0000 0000 address bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 state on reset timer interrupt ?g 2 (tflg2) $0025 tof rtifpaovfpaif0000 0000 0000 tpg 183
motorola 10-24 mc68hc11pa8 timing system 10 paii and paif ?pulse accumulator input edge interrupt enable and ?g the paif status bit is automatically set each time a selected edge is detected at the pa7/pai/oc1 pin. to clear this status bit, write to the tflg2 register with a one in the corresponding data bit position (bit 4). the paii control bit allows the pulse accumulator input edge detect to be con?ured for polled or interrupt-driven operation but does not affect setting or clearing the paif bit. when paii is zero, pulse accumulator input interrupts are inhibited, and the system operates in a polled mode. in this mode, the paif bit must be polled by user software to determine when an edge has occurred. when the paii control bit is set, a hardware interrupt request is generated each time paif is set. before leaving the interrupt service routine, software must clear paif. tpg 184
mc68hc11pa8 motorola 11-1 analog-to-digital converter 11 11 analog-to-digital converter the analog-to-digital (a/d) system, a successive approximation converter, uses an all-capacitive charge redistribution technique to convert analog signals to digital values. the a/d converter shares input pins with port e: note: pins pe5 and pe4 are not present on 64-pin mc68hc11pa8 qfp packaged devices, on which there are only six input channels, but are available on the mc68hc11pb8. pe[5, 4] are present on 68-pin clcc packaged versions of the MC68HC711PA8 and mc68hc711pb8, which are available as samples only. contact your local motorola sales of?e for more information. note: if the mbsp bit in the config register is set, then port e pins [7, 6] are used by the i 2 c bus system; in this case, a/d conversions of the logic levels on these pins have no meaning (see section 4 and section 8). pin alternative function pe0 ad0 pe1 ad1 pe2 ad2 pe3 ad3 pe4 ad4 pe5 ad5 pe6 ad6 / sda pe7 ad7 / scl tpg 185
motorola 11-2 mc68hc11pa8 analog-to-digital converter 11 11.1 overview the a/d system is a 8-channel, 8-bit, multiplexed-input converter. the vddad and vssad pins are used to input supply voltage to the a/d converter. this allows the supply voltage to be bypassed independently. the converter does not require external sample and hold circuits because of the type of charge redistribution technique used. a/d converter timing can be synchronized to the system e clock, or to an internal resistor capacitor (rc) oscillator. the a/d converter system consists of four functional blocks: multiplexer, analog converter, digital control and result storage. refer to figure 11-1. figure 11-1 a/d converter block diagram pe0/ ad2 pe1/ ad3 pe2/ ad4 pe3/ ad5 pe6/ ad6 pe7/ ad7 ccf 0 scan mult cd cc cb ca adctl ?a/d control analog mux result register interface adr1 - a/d result 1 adr2 - a/d result 2 adr3 - a/d result 3 adr4 - a/d result 4 successive approximation register and control 8-bit capacitive dac with sample and hold vrh vrl result internal data bus pe3/ ad5 pe3/ ad5 note: pins pe4 and pe5 are not available on 64-pin packaged devices. tpg 186
mc68hc11pa8 motorola 11-3 analog-to-digital converter 11 11.1.1 multiplexer the multiplexer selects one of 16 inputs for conversion. input selection is controlled by the value of bits cd ?ca in the adctl register. the port e pins are ?ed-direction analog inputs to the multiplexer, and additional internal analog signal lines are routed to it. port e pins can also be used as digital inputs. digital reads of port e pins should be avoided during the sample portion of an a/d conversion cycle, when the gate signal to the n-channel input gate is on. because no p-channel devices are directly connected to either input pins or reference voltage pins, voltages above v dd do not cause a latchup problem, although current and voltage should be limited according to maximum ratings. refer to figure 11-2, which is a functional diagram of an input pin. 11.1.2 analog converter conversion of an analog input selected by the multiplexer occurs in this block. it contains a digital-to-analog capacitor (dac) array, a comparator, and a successive approximation register (sar). each conversion is a sequence of eight comparison operations, beginning with the most signi?ant bit (msb). each comparison determines the value of a bit in the sar. the dac array performs two functions. it acts as a sample and hold circuit during the entire conversion sequence, and provides comparison voltage to the comparator during each successive comparison. the result of each successive comparison is stored in the sar. when a conversion sequence is complete, the contents of the sar are transferred to the appropriate result register. a charge pump provides switching voltage to the gates of analog switches in the multiplexer. charge pump output must stabilize between 7 and 8 volts within up to 100 m s before the converter can be used. the charge pump is enabled by the adpu bit in the option register. figure 11-2 electrical model of an a/d input pin (in sample mode) 4k w <2pf v rl analog input 400na junction leakage diffusion and poly coupler 20pf dac capacitance note 1: the analog switch is closed only during the 12 cycle sample time note 1 input protection device +20v 0.7v note 2: all component values are approximate tpg 187
motorola 11-4 mc68hc11pa8 analog-to-digital converter 11 11.1.3 digital control all a/d converter operations are controlled by bits in register adctl. in addition to selecting the analog input to be converted, adctl bits indicate conversion status, and control whether single or continuous conversions are performed. finally, the adctl bits determine whether conversions are performed on single or multiple channels. 11.1.4 result registers four 8-bit registers (adr1 ?adr4) store conversion results. each of these registers can be accessed by the processor in the cpu. the conversion complete ?g (ccf) indicates when valid data is present in the result registers. the result registers are written during a portion of the system clock cycle when reads do not occur, so there is no con?ct. 11.1.5 a/d converter clocks the csel bit in the option register selects whether the a/d converter uses the system e clock or an internal rc oscillator for synchronization. when e clock frequency is below 750khz, charge leakage in the capacitor array can cause errors, and the internal oscillator should be used. when the rc clock is used, additional errors can occur because the comparator is sensitive to the additional system clock noise. 11.1.6 conversion sequence a/d converter operations are performed in sequences of four conversions each. a conversion sequence can repeat continuously or stop after one iteration. the conversion complete ?g (ccf) is set after the fourth conversion in a sequence to show the availability of data in the result registers. figure 11-3 shows the timing of a typical sequence. synchronization is referenced to the system e clock. 11.1.7 conversion process the a/d conversion sequence begins one e clock cycle after a write to the a/d control/status register, adctl. the bits in adctl select the channel and the mode of conversion. an input voltage equal to v rl converts to $00 and an input voltage equal to v rh converts to $ff (full scale), with no over?w indication. for ratiometric conversions of this type, the source of each analog input should use v rh as the supply voltage and be referenced to v rl . tpg 188
mc68hc11pa8 motorola 11-5 analog-to-digital converter 11 11.2 a/d converter power-up and clock select adpu (bit 7 of the option register) controls a/d converter power up. clearing adpu removes power from and disables the a/d converter system; setting adpu enables the a/d converter system. after the a/d converter is turned on, the analog bias voltages will take up to 100 m s to stabilize. when the a/d converter system is operating from the mcu e clock, all switching and comparator operations are synchronized to the mcu clocks. this allows the comparator results to be sampled at ?uiet times, which minimizes noise errors. the internal rc oscillator is asynchronous with respect to the mcu clock, so noise can affect the a/d converter results. this results in a slightly lower typical accuracy when using the internal oscillator (csel = 1). 11.2.1 option ?system con?uration options register 1 the 8-bit special-purpose option register sets internal system con?uration options during initialization. the time protected control bits, irqe, dly, fcme and cr[1:0] can be written to only once in the ?st 64 cycles after a reset and then they become read-only bits. this minimizes the possibility of any accidental changes to the system con?uration. they may be written at any time in special modes. figure 11-3 a/d conversion sequence address bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 state on reset system con?. options 1 (option) $0039 adpu csel irqe dly cme fcme cr1 cr0 0001 0000 e clock sample analog input successive approximation sequence 12 cycles 4 cycles 2 cyc 2 cyc 2 cyc 2 cyc 2 cyc 2 cyc 2 cyc 2 cyc msb bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 end write to adctl convert ?st channel and update adr1 convert second channel and update adr2 convert third channel and update adr3 convert fourth channel and update adr4 set ccf ?g repeat sequence if scan = 1 0 32 64 96 128 e clock cycles tpg 189
motorola 11-6 mc68hc11pa8 analog-to-digital converter 11 adpu ?a/d power-up 1 (set) a/d system power enabled. 0 (clear) a/d system disabled, to reduce supply current. after enabling the a/d power, at least 100 m s should be allowed for system stabilization. csel ?clock select 1 (set) a/d, eprom and eeprom use internal rc clock source (about 1.5mhz). 0 (clear) a/d, eprom and eeprom use system e clock (must be at least 1mhz). this bit selects an alternative clock source for the on-chip eprom , eeprom and a/d charge pumps. the on-chip rc clock should be used when the e clock frequency falls below 1mhz. irqe ?con?ure irq for falling edge sensitive operation (refer to section 4) 1 (set) falling edge sensitive operation. 0 (clear) low level sensitive operation. dly ?enable oscillator start-up delay (refer to section 4) 1 (set) a stabilization delay is imposed as the mcu is started up from stop mode or from power-on reset. 0 (clear) the oscillator start-up delay coming out of stop is bypassed and the mcu resumes processing within about four bus cycles. a stable external oscillator is required if this option is selected. cme ?clock monitor enable (refer to section 5) 1 (set) clock monitor enabled. 0 (clear) clock monitor disabled. fcme ?force clock monitor enable (refer to section 5) 1 (set) clock monitor enabled, cannot be disabled until next reset. 0 (clear) clock monitor follows the state of the cme bit. cr[1:0] ?cop timer rate select bits (refer to section 5) tpg 190
mc68hc11pa8 motorola 11-7 analog-to-digital converter 11 11.3 channel assignments the multiplexer allows the a/d converter to select one of 16 analog signals. eight of these channels correspond to port e input lines to the mcu, four others are internal reference points or test functions; the remaining six channels are reserved. refer to table 11-1. 11.3.1 single-channel operation there are two types of single-channel operation. in the ?st type (scan = 0), the single selected channel is converted four consecutive times. the ?st result is stored in a/d result register 1 (adr1), and the fourth result is stored in adr4. after the fourth conversion is complete, all conversion activity is halted until a new conversion command is written to the adctl register. in the second type of single-channel operation (scan = 1), conversions continue to be performed on the selected channel with the ?th conversion being stored in register adr1 (overwriting the ?st conversion result), the sixth conversion overwriting adr2, and so on. (1) not available on 64-pin packaged mc68hc11pa8/MC68HC711PA8 devices, but are present on 64-pin packaged mc68hc11pb8/mc68hc711pb8 devices. (2) used for factory testing. table 11-1 a/d converter channel assignments channel number channel signal result in adrx if mult = 1 1 ad0 adr1 2 ad1 adr2 3 ad2 adr3 4 ad3 adr4 5 ad4 (1) adr1 6 ad5 (1) adr2 7 ad6 adr3 8 ad7 adr4 9?2 reserved 13 v rh (2) adr1 14 v rl (2) adr2 15 v rh /2 (2) adr3 16 reserved (2) adr4 tpg 191
motorola 11-8 mc68hc11pa8 analog-to-digital converter 11 11.3.2 multiple-channel operation there are two types of multiple-channel operation. in the ?st type (scan = 0), a selected group of four channels is converted once only. the ?st result is stored in a/d result register 1 (adr1), and the fourth result is stored in adr4. after the fourth conversion is complete, all conversion activity is halted until a new conversion command is written to the adctl register. in the second type of multiple-channel operation (scan = 1), conversions continue to be performed on the selected group of channels with the ?th conversion being stored in register adr1 (replacing the earlier conversion result for the ?st channel in the group), the sixth conversion overwriting adr2, and so on. 11.4 control, status and results registers 11.4.1 adctl ?a/d control and status register all bits in this register can be read or written, except bit 7, which is a read-only status indicator, and bit 6, which always reads as zero. write to adctl to initiate a conversion. to quit a conversion in progress, write to this register and a new conversion sequence begins immediately. ccf ?conversions complete ?g 1 (set) all four a/d result registers contain valid conversion data. 0 (clear) at least one of the a/d result registers contains invalid data. a read-only status indicator, this bit is set when all four a/d result registers contain valid conversion results. each time the adctl register is overwritten, this bit is automatically cleared to zero and a conversion sequence is started. in the continuous mode, ccf is set at the end of the ?st conversion sequence. bit 6 ?not implemented; always reads zero. scan ?continuous scan control 1 (set) a/d conversions take place continuously. 0 (clear) each of the four conversions is performed only once. when this control bit is clear, the four requested conversions are performed once to ?l the four result registers. when this control bit is set, the four conversions are repeated continuously with the result registers updated as data becomes available. address bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 state on reset a/d control & status (adctl) $0030 ccf 0 scan mult cd cc cb ca u0uu uuuu tpg 192
mc68hc11pa8 motorola 11-9 analog-to-digital converter 11 mult ?multiple-channel/single-channel control 1 (set) each a/d channel has a result register allocated to it. 0 (clear) four consecutive conversions from the same a/d channel are stored in the results registers. when this bit is clear, the a/d converter system is con?ured to perform four consecutive conversions on the single channel speci?d by the four channel select bits cd?a (bits 3? of the adctl register). when this bit is set, the a/d system is con?ured to perform a conversion on each of the four channels where each result register corresponds to one channel. note: when the multiple-channel continuous scan mode is used, extra care is needed in the design of circuitry driving the a/d inputs. the charge on the capacitive dac array before the sample time is related to the voltage on the previously converted channel. a charge share situation exists between the internal dac capacitance and the external circuit capacitance. although the amount of charge involved is small, the rate at which it is repeated is every 64 m s for an e clock of 2 mhz. the rc charging rate of the external circuit must be balanced against this charge sharing effect to avoid errors in accuracy. refer to the m68hc11 reference manual (m68hc11rm/ad) for further information. cd?a ?channel selects d? when a multiple channel mode is selected (mult = 1), the two least signi?ant channel select bits (cb and ca) have no meaning and the cd and cc bits specify which group of four channels is to be converted. channel select control bits channel signal result in adrx if mult = 1 cd:cc:cb:ca 0 0 0 0 ad0 adr1 0 0 0 1 ad1 adr2 0 0 1 0 ad2 adr3 0 0 1 1 ad3 adr4 0 1 0 0 ad4 (1) adr1 0 1 0 1 ad5 (1) adr2 0 1 1 0 ad6 adr3 0 1 1 1 ad7 adr4 1 0 x x reserved 1 1 0 0 v rh (2) adr1 1 1 0 1 v rl (1) adr2 1 1 1 0 v rh /2 (1) adr3 1 1 1 1 reserved (1) adr4 tpg 193
motorola 11-10 mc68hc11pa8 analog-to-digital converter 11 11.4.2 adr1?dr4 ?a/d converter results registers these read-only registers hold an 8-bit conversion result. writes to these registers have no effect. data in the a/d converter result registers is valid when the ccf ?g in the adctl register is set, indicating a conversion sequence is complete. if conversion results are needed sooner, refer to figure 11-3, which shows the a/d conversion sequence diagram. 11.5 operation in stop and wait modes if a conversion sequence is in progress when either the stop or wait mode is entered, the conversion of the current channel is suspended. when the mcu resumes normal operation, that channel is resampled and the conversion sequence is resumed. as the mcu exits the wait mode, the a/d circuits are stable and valid results can be obtained on the ?st conversion. however, in stop mode, all analog bias currents are disabled and it is necessary to allow a stabilization period when leaving the stop mode. if the stop mode is exited with a delay (dly = 1), there is enough time for these circuits to stabilize before the ?st conversion. if the stop mode is exited with no delay (dly bit in option register = 0), allow 10 ms for the a/d circuitry to stabilize to avoid invalid results. (1) not available on 64-pin packaged mc68hc11pa8/MC68HC711PA8 devices, but are present on 64-pin packaged mc68hc11pb8/mc68hc711pb8 devices. (2) used for factory testing. address bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 state on reset a/d result 1 (adr1) $0031 (bit 7) (6) (5) (4) (3) (2) (1) (bit 0) unde?ed a/d result 2 (adr2) $0032 (bit 7) (6) (5) (4) (3) (2) (1) (bit 0) unde?ed a/d result 3 (adr3) $0033 (bit 7) (6) (5) (4) (3) (2) (1) (bit 0) unde?ed a/d result 4 (adr4) $0034 (bit 7) (6) (5) (4) (3) (2) (1) (bit 0) unde?ed tpg 194
mc68hc11pa8 motorola a-1 electrical specifications a a electrical specifications this section contains the electrical speci?ations and associated timing information for the standard supply voltage (v dd = 5v 10%) mc68hc11pa8/mc68hc11pb8 variants. a.1 maximum ratings note: this device contains circuitry designed to protect against damage due to high electrostatic voltages or electric ?lds. however, it is recommended that normal precautions be taken to avoid the application of any voltages higher than those given in the maximum ratings table to this high impedance circuit. for maximum reliability all unused inputs should be tied to either v ss or v dd . a.2 thermal characteristics and power considerations the average chip junction temperature, t j , in degrees celsius can be obtained from the following equation: (1) all voltages are with respect to v ss . (2) maximum current drain per pin is for one pin at a time, observing maximum power dissipation limits. rating symbol value unit supply voltage (1) v dd ?0.3 to +7.0 v input voltage (1) v in ?0.3 to +7.0 v operating temperature range mc68hc11pa8, MC68HC711PA8, mc68hc11pb8, mc68hc711pb8 t a t l to t h 40 to +85 c storage temperature range t stg ?55 to +150 c current drain per pin (2) ?not vdd, vss, vdd ad, vss ad, vrh or vrl i d 25 ma tpg 195
motorola a-2 mc68hc11pa8 electrical specifications a [1] where: t a = ambient temperature ( c) q ja = package thermal resistance, junction-to-ambient ( c/w) p d = total power dissipation = p int + p i/o (w) p int = internal chip power = i dd ?v dd (w) p i/o = power dissipation on input and output pins (user determined) an approximate relationship between p d and t j (if p i/o is neglected) is: [2] solving equations [1] and [2] for k gives: [3] where k is a constant for a particular part. k can be determined by measuring p d (at equilibrium) for a known t a . using this value of k, the values of p d and t j can be obtained for any value of t a , by solving the above equations. the package thermal characteristics are shown below: characteristics symbol value unit thermal resistance ?64-pin qfp package q ja 50 c/w t j t a p d q ja () + = p d k t j 273 + ---------------------- = kp d t a 273 + () q ja p d 2 + = tpg 196
mc68hc11pa8 motorola a-3 electrical specifications a a.3 test methods figure a-1 test methods ~v dd 0.4v v dd ?0.8v 0.4v nominal nominal ~v ss 70% of v dd 20% of v dd nominal timing ~v dd ~v ss v dd ?0.8v 0.4v clocks, strobes inputs outputs ~v dd 20% of v dd spec. spec. ~v ss 70% of v dd 20% of v dd spec. timing ~v dd ~v ss clocks, strobes inputs outputs (a) dc testing (b) ac testing 20% of v dd 70% of v dd v dd ?0.8v (2) 0.4v (2) 70% of v dd 20% of v dd notes: (1) full test loads are applied during all dc electrical tests and ac timing measurements. (2) during ac timing measurements, inputs are driven to 0.4v and v dd ?0.8v; timing measurements are taken at the 20% and 70% of v dd points. tpg 197
motorola a-4 mc68hc11pa8 electrical specifications a a.4 dc electrical characteristics (1) v oh speci?ation for reset and moda is not applicable as they are open-drain pins. v oh speci?ation is not applicable to port c and port d in wired-or mode. (2) refer to a/d speci?ation for the leakage current value for port e. (v dd = 5.0 vdc 10%, v ss = 0 vdc, t a = t l to t h , unless otherwise noted) characteristic symbol min. max. unit output voltage (1) ( i load = 10 m a ): all outputs except xtal all outputs except xtal, reset & moda v ol v oh v dd ?0.1 0.1 v v output high voltage (1) ( i load = ?.8ma, v dd =4.5v ): all outputs except xtal, reset & moda v oh v dd ?0.8 v output low voltage ( i load = +1.6ma ): all outputs except xtal v ol 0.4 v input high voltage: all inputs except reset reset v ih 0.7v dd 0.8v dd v dd + 0.3 v dd + 0.3 v input low voltage ?all inputs v il v ss ?0.3 0.2v dd v i/o ports three-state leakage ( v in = v ih or v il ) (2) : ports a, b, c, d, f, g, moda/lir , reset i oz 10 m a input leakage (2) ( v in = v dd or v ss ): modb/vstby irq , xirq (rom parts) xirq (eprom parts) i in 10 1 10 m a input current with pull-up resistors ( v in = v il ): ports b, f, g i ipr 20 100 m a ram stand-by voltage (power down) v sb 2.0 v dd v ram stand-by current (power down) i sb ?0 m a input capacitance: port e, irq , xirq , extal ports a, b, c, d, f, g, moda/lir , reset c in 8 12 pf output load capacitance: all outputs except pd[4:1], 4xout, xtal, moda/lir 4xout pd[4:1] c l 90 30 200 pf tpg 198
mc68hc11pa8 motorola a-5 electrical specifications a a.4.1 dc electrical characteristics ?modes of operation a.5 control timing (1) all current measurements taken with suitable decoupling capacitors across the power supply to suppress the transient switching currents inherent in cmos designs. extal is driven with a square wave, with t cyc = 167ms for 6khz devices; 333/250ns for 3/4mhz devices. vil 0.2v; vih 3 vdd ?0.2v; no dc loads wait: all peripheral functions shut down stop: all clocks stopped (1) all timing is given with respect to 20% and 70% of v dd , unless otherwise noted. (v dd = 5.0 vdc 10%, v ss = 0 vdc, t a = t l to t h , unless otherwise noted) characteristic symbol 3mhz 4mhz 4.4mhz unit maximum total supply current (including pll) (1) : run: single chip mode run: expanded mode wait: single chip mode wait: expanded mode stop: single chip mode i dd 32 42 15 17 50 40 50 20 22 50 40 50 20 22 50 ma ma ma ma m a maximum power dissipation: single chip mode maximum power dissipation: expanded mode p d 176 231 220 275 220 275 mw mw (v dd = 5.0 vdc 10%, v ss = 0 vdc, t a = t l to t h ) characteristic (1) symbol 3.0mhz 4.0mhz 4.4mhz unit min. max. min. max. min. max. frequency of operation f op 0 3.0 0 4.0 0 4.4 mhz e clock period t cyc 333 250 225 ns crystal frequency f xtal 12.0 16.0 17.6 mhz external oscillator frequency 4f op 0 12.0 0 16.0 0 17.6 mhz processor control set-up time (t pcsu = t cyc /4 + 50ns) t pcsu 133 112 106 ns reset input pulse width (2) pw rstl (3) pw rstl (4) 16 1 16 1 16 1 t cyc mode programming set-up time t mps 2 2?t cyc mode programming hold time t mph 10 10?0ns interrupt pulse width (irq edge sensitive mode) pw irq t cyc +20 t cyc +20? cyc +20 ns timer pulse width (input capture and pulse accumulator inputs) pw tim t cyc +20 t cyc +20? cyc +20 ns wait recovery start-up time t wrs 4 ??t cyc clock monitor reset (5) f cmon 10 200 10 200 10 200 khz tpg 199
motorola a-6 mc68hc11pa8 electrical specifications a (2) reset is recognized during the ?st clock cycle it is held low. internal circuitry then drives the pin low for eight clock c ycles, releases the pin and samples the pin level four cycles later to determine the source of the interrupt. (see section 5.) (3) to guarantee an external reset vector. (4) this is the minimum input time; it can be pre-empted by an internal reset. (5) do not use the clock monitor when the e clock is below f cmon maximum value. figure a-2 timer inputs pw tim notes pa[3:0] (2) pa[3:0] (1) pa7 (1), (3) pa7 (2), (3) (1) rising edge sensitive input. (2) falling edge sensitive input. (3) maximum pulse accumulator clocking rate is e clock frequency divided by two (e/2). tpg 200
mc68hc11pa8 motorola a-7 electrical specifications a figure a-3 reset timing figure a-4 interrupt timing ffff fffe fffe fffe fffe fffe new ffff fffe fffe fffe fffe pc new pc v dd extal e reset moda, address modb t pordelay (1) t pcsu pw rstl t mps t mph (1) t pordelay = 4064 t cyc (or 128 t cyc depending on mask option - mc68hc11pa8/mc68hc11pb8 only) va+1 va sp? sp? e clock address (3) oa notes: sp? sp? sp oa+1 r/w t pcsu sp? sp? sp? sp? new pc sp? pw irq ? pcl pch iyl iyh op ixl ixh b a ccr ? vh vl op data (4) irq (1) irq (2) , xirq or internal interrupt (1) edge sensitive irq pin (irqe = 1). (2) level sensitive irq pin (irqe = 0). (3) where oa = opcode address and va = vector address. (4) where op = opcode, vh = vector (msb) and vl = vector (lsb). tpg 201
motorola a-8 mc68hc11pa8 electrical specifications a figure a-5 stop recovery timing figure a-6 wait recovery timing fff3 fff2 sp? sp? sp? sp sa+2 new pc internal irq (1) e clock address (5) clocks sa+1 sa (6) sa+1 pw irq t stopdelay (3) irq (2) or xirq notes: (1) edge sensitive irq pin (irqe = 1). (2) level sensitive irq pin (irqe = 0). (4) sa = stop address. (3) if dly = 1: t stopdelay = 4064 t cyc (or 128 t cyc depending on mask option - mc68hc11pa8/mc68hc11pb8 only) if dly = 0: t stopdelay = 4 t cyc or xirq va+1 va (2) sp? sp? e clock address wa (1) wa+1 notes: reset also causes recovery from wait. (1) wa = wait address. (2) va = vector address. sp? sp??p? sp? sp??p? sp? sp new pc irq , xirq , or internal interrupts r/w t pcsu t wrs stack registers tpg 202
mc68hc11pa8 motorola a-9 electrical specifications a a.5.1 peripheral port timing (1) all timing is given with respect to 20% and 70% of v dd , unless otherwise noted. (2) port c and d timing is valid for active drive (cwom, dwom, and woms bits clear). (v dd = 5.0 vdc 10%, v ss = 0 vdc, t a = t l to t h ) characteristic (1) symbol 3.0mhz 4.0mhz 4.4mhz unit min. max. min. max. min. max. frequency of operation (e clock frequency) f op 0 3.0 0 4.0 0 4.4 mhz e clock period t cyc 333 250 225 ns peripheral data set-up time, all ports (2) t pdsu 100 100 100 ns peripheral data hold time, all ports (2) t pdh 50 50 50 ns delay time, peripheral data write mcu write to port a, b or g mcu write to port c, d or f (t pwd = t cyc /4 + 100ns) t pwd 200 183 200 162 200 156 ns figure a-7 port read timing diagram figure a-8 port write timing diagram mcu read of port e clock ports a, c, d, f ports t pdsu t pdh t pdsu t pdh b, e, g t pwd mcu write to port t pwd previous port data new data valid previous port data new data valid e clock ports c, d, f ports a, b, g tpg 203
motorola a-10 mc68hc11pa8 electrical specifications a a.5.2 pll control timing (1) this mask option does not exist on the MC68HC711PA8/mc68hc711pb8, on which the pll is optimized for use at frequencies of 2mhz and above. (2) assumes that stable vddsyn is applied and that the crystal oscillator is stable. stabilization time is measured from power-u p to reset release. this speci?ation also applies to the period required for pll stabilization after changing the x and y frequency control bits in the synthesizer control register (synr) while pll is running, and to the period required for the cloc k to stabilize after wait with wen = 1. (3) short term stability is the average deviation from programmed frequency measured over a 2 m s interval at maximum f sys , long term 4xclk stability is the average deviation from programmed frequency measured over a 1ms interval at maximum f sys . stability is measured with a stable external clock applied ?variation in crystal oscillator frequency is additive to this ?ur e. (4) this parameter is periodically sampled rather than 100% tested. (5) these parameters guaranteed by design. (vdd = 5.0vdc 10%, vss = 0vdc, t a = t l to t h unless otherwise noted) characteristic symbol mask option 1 (1) mask option 2 (1) mask option 3 units min typ max min typ max min typ max pll reference frequency f ref 25 32 50 50 614 2000 2000 4000 16000 khz system frequency pll output frequency external clock operation f sys f vcoout f xtal dc 0.05 dc 4.4 17.6 17.6 dc 0.1 dc 4.4 17.6 17.6 dc 2 dc 4.4 17.6 16.6 mhz capacitor on pin xfc c xfc 47 47 ?.7 nf pll stabilization time (2)(5) t plls 1.5 ms 4xclk stability (3)(4)(5) short term long term c stab 0.15 0.15 % tpg 204
mc68hc11pa8 motorola a-11 electrical specifications a a.5.3 analog-to-digital converter characteristics (1) for f op < 2mhz, source impedances should be approximately 10k w . for f op 3 2mhz, source impedances should be in the range 5-10k w . source impedances greater than 10k w . have an adverse effect on a/d accuracy, because of input leakage (2) performance veri?d down to d v r = 2.5v, however accuracy is tested and guaranteed at d v r = 5v 10% (3) pe[4,5] available on 68-pin clcc devices and 64-pin qfp mc68hc(7)11pb8 devices only (v dd = 5.0 vdc 10%, v ss = 0 vdc, t a = t l to t h , 750khz e 3mhz, unless otherwise noted) characteristic parameter min. absolute 3mhz (1) 4mhz (1) 4.4mhz (1) unit max. max. max. resolution number of bits resolved by adc 8 bits non-linearity maximum deviation from the ideal adc transfer characteristics 1 1 1 lsb zero error difference from the output of an ideal adc for zero input voltage 1 1 1 lsb full-scale error difference from the output of an ideal adc for full-scale input voltage 1 1 1 lsb total unadjusted error maximum sum of non-linearity, zero and full-scale errors 1.5 1.5 1.5 lsb quantization error uncertainty due to converter resolution 0.5 0.5 0.5 lsb absolute accuracy difference between the actual input voltage and the full-scale weighted equivalent of the binary output code, including all error sources 2 2 2 lsb conversion range analog input voltage range v rl ? rh v rh v rh v v rh analog reference voltage (high) (1) v rl ? dd +0.1 v dd +0.1 v dd +0.1 v v rl analog reference voltage (low) (2) v ss ?.1 v rh v rh v rh v d v r minimum difference between v rh and v rl (2) 3v conversion time total time to perform a single a/d conversion: e clock internal rc oscillator 32 t cyc +32 t cyc +32 t cyc +32 t cyc m s monotonicity conversion result never decreases with an increase in input voltage and has no missing codes guaranteed zero input reading conversion result when v in = v rl $00 hex full-scale reading conversion result when v in = v rh $ff $ff $ff hex sample acquisition time analog input acquisition sampling time: e clock internal rc oscillator 12 12 12 12 t cyc m s sample/hold capacitance input capacitance (pe[0:7]) during sample (3) 20 (typ) pf input leakage input leakage on a/d pins: (3) pe[0:7] vrl, vrh 400 1.0 400 1.0 400 1.0 na m a tpg 205
motorola a-12 mc68hc11pa8 electrical specifications a a.5.4 serial peripheral interface timing (1) all timing is given with respect to 20% and 70% of v dd , unless otherwise noted. (2) signal production depends on software. (3) assumes 200pf load on all spi pins. (v dd = 5.0 vdc 10%, v ss = 0 vdc, t a = t l to t h ) num characteristic (1) symbol 3.0mhz 4.0mhz 4.4mhz unit min. max. min. max. min. max. operating frequency master slave f op(m) f op(s) 0 0 0.5 3.0 0 0 0.5 4.0 0 0 0.5 4.4 f op mhz 1 cycle time master slave t cyc(m) t cyc(s) 2.0 333 2.0 250 2.0 225 t cyc ns 2 enable lead time (2) master slave t lead(m) t lead(s) 240 200 200 ns 3 enable lag time (2) master slave t lag(m) t lag(s) 240 200 200 ns 4 clock (sck) high time master slave t w(sckh)m t w(sckh)s 227 127 130 85 130 85 ns 5 clock (sck) low time master slave t w(sckl)m t w(sckl)s 227 127 130 85 130 85 ns 6 input data set-up time master slave t su(m) t su(s) 100 100 100 100 100 100 ns 7 input data hold time master slave t h(m) t h(s) 100 100 100 100 100 100 ns 8 access time (from high-z to data active) slave t a 0 120 0 120 0 120 ns 9 disable time (hold time to high-z state) slave t dis 167 125 125 ns 10 data valid (after enable edge) (3) t v(s) 167 125 125 ns 11 output data hold time (after enable edge) t ho 0??ns 12 rise time (3) spi outputs (sck, mosi and miso) spi inputs (sck, mosi, miso and ss ) t rm t rs 100 2.0 100 2.0 100 2.0 ns m s 13 fall time (3) spi outputs (sck, mosi and miso) spi inputs (sck, mosi, miso and ss ) t fm t fs 100 2.0 100 2.0 100 2.0 ns m s tpg 206
mc68hc11pa8 motorola a-13 electrical specifications a figure a-9 spi master timing (cpha = 0) figure a-10 spi master timing (cpha = 1) 1 ss (input) sck (cpol=0) (output) sck (cpol=1) (output) miso (input) mosi (output) (see note) (see note) ss is held high on master msb in lsb in bit 61 master msb out bit 61 master lsb out 13 12 13 5 4 4 5 7 11 10 12 13 6 10 (ref.) 11 (ref.) 12 note: this ?st clock edge is generated internally, but is not seen at the sck pin. 1 ss (input) sck (cpol=0) (output) sck (cpol=1) (output) miso (input) mosi (output) (see note) ss is held high on master msb in lsb in bit 61 master msb out bit 61 master lsb out 12 13 12 5 4 4 5 11 10 12 13 10 (ref.) 11 (ref.) 13 note: this last clock edge is generated internally, but is not seen at the sck pin. (see note) 7 6 tpg 207
motorola a-14 mc68hc11pa8 electrical specifications a figure a-11 spi slave timing (cpha = 0) figure a-12 spi slave timing (cpha = 1) 1 ss (input) sck (cpol=0) (input) sck (cpol=1) (input) mosi (input) miso (output) msb in lsb in bit 61 slave msb out bit 61 slave lsb out 12 13 12 5 4 4 5 8 11 13 note: not de?ed, but normally the msb of character just received. 7 6 10 (see note) 9 3 2 1 ss (input) sck (cpol=0) (input) sck (cpol=1) (input) mosi (input) miso (output) msb in lsb in bit 61 slave msb out bit 61 slave lsb out 12 13 12 5 4 4 5 8 11 13 note: not de?ed, but normally the lsb of character last transmitted. 7 6 10 (see note) 9 3 2 tpg 208
mc68hc11pa8 motorola a-15 electrical specifications a a.5.5 non-multiplexed expansion bus timing (1) all timing is given with respect to 20% and 70% of v dd , unless otherwise noted. (2) input clock duty cycles other than 50% will affect the bus performance. (3) for f op 2mhz the following formulae may be used to calculate parameter values: pw el = t cyc /2 ?20ns pw eh = t cyc /2 ?25ns t ah = t cyc /8 ?10ns t ad = t cyc /8 + 40ns t av = pw el ?t ad t dhw = t cyc /8 t acca = t cyc ?t f ?t dsr ?t ad t dsw = pw eh ?t ddw (v dd = 5.0 vdc 10%, v ss = 0 vdc, t a = t l to t h ) num characteristic (1) symbol 3.0mhz 4.0mhz 4.4mhz unit min. max. min. max. min. max. frequency of operation (e clock frequency) f op 0 3.0 0 4.0 0 4.4 mhz 1 e clock period t cyc 333 250 225 ns 2 pulse width, e low (2), (3) pw el 147 105 92 ns 3 pulse width, e high (2), (3) pw eh 142 100 87 ns 4a 4b e clock rise time fall time t r t f 20 18 20 15 20 15 ns 9 address hold time (3) t ah 32?1?8ns 11 address delay time (3) t ad ?2?1?8ns 12 address valid to e rise time (3) t av 65?4?4ns 17 read data set-up time t dsr 30?0?0ns 18 read data hold time t dhr 0 10?0ns 19 write data delay time t ddw ?0?0?0ns 21 write data hold time (3) t dhw 42?1?8ns 29 mpu address access time (3) t acca 203 144 122 ns 39 write data set-up time (3) t dsw 102?0?7ns 57 address valid to data three-state time t avdz ?0?0?0ns tpg 209
motorola a-16 mc68hc11pa8 electrical specifications a a.6 eeprom characteristics (1) the rc oscillator (rco) must be enabled (by setting the csel bit in the option register) for eeprom programming and erasure when the e clock frequency is less than 1.0mhz. (2) refer to the current issue of motorolas quarterly reliability monitor report for the latest failure rate information. figure a-13 expansion bus timing characteristic temperature range unit 40 to +85 c programming time, t eeprog (1) <1mhz, rco enabled 1?mhz, rco disabled 3 2mhz & whenever rco enabled 10 20 10 ms erase time: byte, row and bulk (1) 10 ms write/erase endurance (2) 10000 cycles data retention (2) 10 years e clock r/w , address data (read) data (write) 1 2 3 4b 4a 12 11 9 18 21 39 17 29 57 19 tpg 210
mc68hc11pa8 motorola a-17 electrical specifications a a.7 eprom characteristics (v dd = 5.0 vdc 10%, v ss = 0 vdc, t a = t l to t h , unless otherwise noted) characteristic symbol min max unit programming voltage v ppe 12 12.75 v programming voltage detect level v pph tbd tbd v programming time t eprog ? ms
motorola a-18 mc68hc11pa8 electrical specifications a this page left blank intentionally
mc68hc11pa8 motorola b-1 mechanical data and ordering information b b mechanical data and ordering information the mc68hc11pa8/mc68hc11pb8, and an otprom version of the MC68HC711PA8/mc68hc711pb8, are available packaged in a 64-pin quad ?t pack (qfp). figure b-1 64-pin qfp pinout (mc68hc11pa8) pc4/d4 pc5/d5 pc7/d7 17 18 20 21 22 23 24 25 26 27 29 19 pd1/txd pd2/miso pd3/mosi/sda pd4/sck/scl pd5/ss vss vddex vdd pa7/pai/oc1 pb7/a15 pb6/a14 pb4/a12 pb3/a11 pb2/a10 pb1/a9 vddsyn xfc pe7/ad7/scl pe6/ad6/sda xirq / vppe pb5/a13 pd0/rxd moda/lir reset xtal extal e pc6/d6 pc3/d3 pc2/d2 modb/vstby 1 2 4 5 6 7 8 9 10 11 12 13 3 pb0/a8 28 64 63 61 60 59 58 56 55 54 53 52 62 57 pa3/oc5/ic4/oc1 pc1/d1 pa6/oc2/oc1 pa5/oc3/oc1 pa4/oc4/oc1 14 15 16 30 31 32 51 50 49 pc0/d0 pf0/a0 pa2/ic1 pa1/ic2 pa0/ic3 48 47 46 45 44 43 42 41 40 pf1/a1 pf2/a2 pf4/a4 pf5/a5 pf6/a6 pf7/a7 vss vssad vrh vrl pe0/ad0 pe1/ad1 pf3/a3 36 39 38 37 pe2/ad2 pe3/ad3 vssex 35 34 33 pg7/r/w irq vddad tpg 211
motorola b-2 mc68hc11pa8 mechanical data and ordering information b figure b-2 64-pin qfp pinout (mc68hc11pb8) pc4/d4 pc5/d5 pc7/d7 17 18 20 21 22 23 24 25 26 27 29 19 pd1/txd pd2/miso pd3/mosi/sda pd4/sck/scl pd5/ss vss vddex vdd pa7/pai/oc1 pb7/a15 pb6/a14 pb4/a12 pb3/a11 pb2/a10 pb1/a9 vddsyn xfc pe7/ad7/scl pe6/ad6/sda xirq / vppe pb5/a13 pd0/rxd moda/lir reset xtal extal e pc6/d6 pc3/d3 pc2/d2 modb/vstby 1 2 4 5 6 7 8 9 10 11 12 13 3 pb0/a8 28 64 63 61 60 59 58 56 55 54 53 52 62 57 pa3/oc5/ic4/oc1 pc1/d1 pa6/oc2/oc1 pa5/oc3/oc1 pa4/oc4/oc1 14 15 16 30 31 32 51 50 49 pc0/d0 pf0/a0 pa2/ic1 pa1/ic2 pa0/ic3 48 47 46 45 44 43 42 41 40 pf1/a1 pf2/a2 pf4/a4 pf5/a5 pf6/a6 pf7/a7 vss/vssad vrh vrl pe0 pe1 pe2 pf3/a3 36 39 38 37 pe3 pe4 pe5 35 34 33 pg7/r/w irq vddad tpg 212
mc68hc11pa8 motorola b-3 mechanical data and ordering information b figure b-3 64-pin qfp mechanical dimensions case no. 840c 64 lead qfp 0.20 m c a ?b s d s l 33 48 16 1 32 17 49 64 - b - b v 0.05 a ?b - d - a s 0.20 m h a ?b s d s l - a - detail ? b b - a, b, d - p detail ? f n j d section b? base metal g h e c -c- m detail ? m -h- datum plane seating plane u t r q k w x dim. min. max. notes dim. min. max. a 13.90 14.10 1. datum plane ??is located at bottom of lead and is coincident with the lead where the lead exits the plastic body at the bottom of the parting line. 2. datums a? and ? to be determined at datum plane ?? 3. dimensions s and v to be determined at seating plane ?? 4. dimensions a and b do not include mould protrusion. allowable mould protrusion is 0.25mm per side. dimensions a and b do include mould mismatch and are determined at datum plane ?? 5. dimension d does not include dambar protrusion. allowable dambar protrusion shall be 0.08 total in excess of the d dimension at maximum material condition. dambar cannot be located on the lower radius or the foot. 6. dimensions and tolerancing per ansi y 14.5m, 1982. 7. all dimensions in mm. m5 10 b 13.90 14.10 n 0.130 0.170 c 2.067 2.457 p 0.40 bsc d 0.30 0.45 q 2 8 e 2.00 2.40 r 0.13 0.30 f 0.30 s 16.20 16.60 g 0.80 bsc t 0.20 ref h 0.067 0.250 u 9 15 j 0.130 0.230 v 16.20 16.60 k 0.50 0.66 w 0.042 nom l 12.00 ref x 1.10 1.30 0.20 m c a ?b s d s 0.05 a ?b 0.20 m h a ?b s d s 0.20 m c a ?b s d s tpg 213
motorola b-4 mc68hc11pa8 mechanical data and ordering information b b.1 ordering information use the information in the following tables to specify the appropriate device when placing an order. to specify a custom rom device, ?st select a standard source device, then complete a custom rom device order form. the order form can be obtained from your local motorola sales of?e or distributer. table b-1 standard device ordering information package temperature description frequency mc order number 64-pin qfp ?0 to +85 c otprom (with security feature) 3mhz 4mhz mc68s711pa8cfu3 mc68s711pa8cfu4 64-pin qfp ?0 to +85 c otprom (with security feature) 3mhz 4mhz mc68s711pb8cfu3 mc68s711pb8cfu4 table b-2 custom rom device ordering information package temperature description frequency source device 64-pin qfp ?0 to +85 c custom rom 3mhz 4mhz mc68hc11pa8cfu3 mc68hc11pa8cfu4 64-pin qfp ?0 to +85 c custom rom 3mhz 4mhz mc68hc11pb8cfu3 mc68hc11pb8cfu4 tpg 214
mc68hc11pa8 motorola c-1 development support c c development support the following information provides a reference to development tools for the m68hc11 family of microcontrollers. for more detailed information please refer to the appropriate system manual. note: target cables for the evaluation module should be ordered separately. c.1 evs ?evaluation system the evs is an economical tool for designing, debugging and evaluating target systems based on the mc68hc11pa8 and MC68HC711PA8 device types. the two printed circuit boards that comprise the evs are the m68em11pa8 emulator module and the m68hc11pfb platform board. the main features of the evs are as follows: monitor/debugger ?mware single-line assembler/disassembler host computer download capability dual memory maps: 64kbyte monitor map that includes 16kbytes of monitor eprom MC68HC711PA8 user map that includes 64kbytes of emulation ram mcu extension i/o port for single chip, expanded and special test operating modes rs-232c terminal and host i/o ports logic analyser connector table c-1 m68hc11 development tools devices evaluation boards evaluation modules evaluation systems/kits programmer boards mc68hc11pa8, MC68HC711PA8 m68em11pa8 m68spgmr11 tpg 215
motorola c-2 mc68hc11pa8 development support c c.2 mmds11 ?motorola modular development system the mmds11 is an emulator system that provides a bus state analyser and real-time memory windows. the units integrated design environment includes an editor, an assembler, user interface and source-level debug. a complete mmds11 consists of: a station module ?the metal mmds11 enclosure, containing the control board and the internal power supply. most system cables connect to the mmds11 station module. (the cable to an optional target system, however, runs through an aperture in the station module enclosure to connect directly to the emulator module). an emulator module (em) ?such as the em11pa8: a printed circuit board that enables system functionality for a speci? set of mcus. the em ?s into the station module through a sliding panel in the enclosure top. the em has a connector for the target cable. two logic clip cable assemblies ?twisted pair cables that connect the station module to your target system, a test ?ture, a clock or any other circuitry useful for evaluation or analysis. one end of each cable assembly has a moulded connector, which ?s into station module pod a or pod b. leads at the other end of the cable terminate in female probe tips. ball clips come with the cables. a 9-lead rs-232 serial cable ?the cable that connects the station module to the host computers rs-232 port. c.3 spgmr11 ?serial programmer system the spgmr11 is an economical tool for programming m68hc11 mcus. the system consists of the m68spgmr11 unit and a programming module which adapts the spgmr11 to the appropriate mcu and package type. the programming module can be ordered as m68pa11pa8fu64 for 64-pin qfp packaged devices, or m68pa11ka4fn68 for 68-pin clcc packaged devices. tpg 216
mc68hc11pa8 motorola i glossary glossary this section contains abbreviations and specialist words used in this data sheet and throughout the industry. further information on many of the terms may be gleaned from motorolas m68hc11 reference manual, m68hc11rm/ad , or from a variety of standard electronics text books. $xxxx the digits following the ? are in hexadecimal format. %xxxx the digits following the ? are in binary format. a/d , adc analog-to-digital (converter). bootstrap mode in this mode the device automatically loads its internal memory from an external source on reset and then allows this program to be executed. byte eight bits. ccr condition codes register; an integral part of the cpu. cerquad a ceramic package type, principally used for eprom and high temperature devices. clear ? ?the logic zero state; the opposite of ?et? cmos complementary metal oxide semiconductor. a semiconductor technology chosen for its low power consumption and good noise immunity. cop computer operating properly. aka ?atchdog? this circuit is used to detect device runaway and provide a means for restoring correct operation. cpu central processing unit. d/a, dac digital-to-analog (converter). eeprom electrically erasable programmable read only memory. aka ?erom? eprom erasable programmable read only memory. this type of memory requires exposure to ultra-violet wavelengths in order to erase previous data. aka ?rom? esd electrostatic discharge. expanded mode in this mode the internal address and data bus lines are connected to external pins. this enables the device to be used in much more complex systems, where there is a need for external memory for example. tpg 217
motorola ii mc68hc11pa8 glossary evs evaluation system. one of the range of platforms provided by motorola for evaluation and emulation of their devices. hcmos high-density complementary metal oxide semiconductor. a semiconductor technology chosen for its low power consumption and good noise immunity. i 2 c bus the i 2 c bus is a two wire, bidirectional serial communications protocol. i 2 c bus is a proprietary philips interface bus. i/o input/output; used to describe a bidirectional pin or function. input capture (ic) this is a function provided by the timing system, whereby an external event is ?aptured by storing the value of a counter at the instant the event is detected. interrupt this refers to an asynchronous external event and the handling of it by the mcu. the external event is detected by the mcu and causes a predetermined action to occur. irq interrupt request. the overline indicates that this is an active-low signal format. k byte a kilo-byte (of memory); 1024 bytes. lcd liquid crystal display. lsb least signi?ant byte. m68hc11 motorolas family of advanced 8-bit mcus. mcu microcontroller unit. msb most signi?ant byte. nibble half a byte; four bits. nrz non-return to zero. opcode the opcode is a byte which identi?s the particular instruction and operating mode to the cpu. see also: prebyte, operand. operand the operand is a byte containing information the cpu needs to execute a particular instruction. there may be from 0 to 3 operands associated with an opcode. see also: opcode, prebyte. output compare (oc) this is a function provided by the timing system, whereby an external event is generated when an internal counter value matches a prede?ed value. plcc plastic leaded chip carrier package. pll phase-locked loop circuit. this provides a method of frequency multiplication, to enable the use of a low frequency crystal in a high frequency circuit. prebyte this byte is sometimes required to qualify an opcode, in order to fully specify a particular instruction. see also: opcode, operand. tpg 218
mc68hc11pa8 motorola iii glossary pull-down, pull-up these terms refer to resistors, sometimes internal to the device, which are permanently connected to either ground or v dd . pwm pulse width modulation. this term is used to describe a technique where the width of the high and low periods of a waveform is varied, usually to enable a representation of an analog value. qfp quad ?t pack package. ram random access memory. fast read and write, but contents are lost when the power is removed. rfi radio frequency interference. rti real-time interrupt. rom read-only memory. this type of memory is programmed during device manufacture and cannot subsequently be altered. rs-232c a standard serial communications protocol. sar successive approximation register. sci serial communications interface. set ? ?the logic one state; the opposite of ?lear? silicon glen an area in the central belt of scotland, so called because of the concentration of semiconductor manufacturers and users found there. single chip mode in this mode the device functions as a self contained unit, requiring only i/o devices to complete a system. spi serial peripheral interface. test mode this mode is intended for factory testing. ttl transistor-transistor logic. uart universal asynchronous receiver transmitter. vco voltage controlled oscillator. watchdog see ?op? wired-or a means of connecting outputs together such that the resulting composite output state is the logical or of the state of the individual outputs. word two bytes; 16 bits. xirq non-maskable interrupt request. the overline indicates that this has an active-low signal format. tpg 219
motorola iv mc68hc11pa8 glossary this page left blank intentionally tpg 220
mc68hc11pa8 motorola v index index in this index numeric entries are placed ?st; page references in italics indicate that the reference is to a ?ure. 4xclk 2-9 , 2-10 a a/d 11-1 accuracy of conversion 6-6 adctl ?a/d control and status reg. 11-8 adr1?dr4 ?a/d converter results reg. 11-10 block diagram 11-2 channels 11-7 , 11-9 charge pump 11-3 clocks 11-4 conversion 11-3 , 11-4 , 11-5 , 11-8 input pin 11-3 multiple-channel operation 11-8 , 11-9 multiplexer 11-3 , 11-7 option ?system configuration options reg. 1 11-5 overview 11-2 pins 11-1 reset 5-9 single-channel operation 11-7 stop mode 11-10 synchronisation 11-4 wait mode 11-10 accumulators 3-2 adctl ?a/d control and status reg. 11-8 addressing modes 3-7 address-mark wakeup 7-4 adpu - bit in option 11-6 adr1?dr4 ?a/d converter results reg. 11-10 analog-to-digital converter - see a/d auto - bit in pllcr 2-9 b baud rates bootloader 4-2 sci 7-6 bcs - bit in pllcr 2-9 block diagrams a/d 11-2 mc68hc(7)11pa8 1-3 pll 2-6 pulse accumulator 10-21 sci 7-3 sci baud rate 7-1 spi 9-2 timer 10-5 timer clock divider chains 10-3 bootloader 4-2 , 4-5 , 4-6 bppue - bit in ppar 6-10 bprot ?block protect reg. 4-20 bprt[5:0] - bits in bprot 4-20 brst - bit in scbdh 7-6 bspl - bit in scbdh 7-6 btst - bit in scbdh 7-6 bulkp - bit in bprot 4-20 bwc - bit in pllcr 2-10 bypassing 2-2 , 2-7 byte - bit in pprog 4-25 c c-bit in ccr 3-5 ccf - bit in adctl 11-8 ccr ?condition code reg. 3-4 cd?a - bits in adctl 11-9 cforc ?timer compare force reg. 10-10 charge pump, a/d 11-3 clk4x - bit in config 4-13 clock monitor 5-3 , 5-5 clocks 4xclk 2-9 , 2-10 a/d 11-4 cmos compatible 2-3 e 2-3 , 4-19 monitor reset 5-3 , 5-5 spi 9-4 stretching 4-18 timer divider chains 10-3 cme - bit in option 5-5 coherency, timer 10-10 config ?system configuration reg. 4-12 programming 4-27 tpg 221
motorola vi mc68hc11pa8 index configuration 4-12 conversion, a/d 11-3 , 11-4 , 11-5 cop 10-2 , 10-20 config ?configuration control reg. 5-5 coprst ?arm/reset cop timer circuitry reg. 5-3 enable 5-6 option ?system configuration options reg. 1 5-4 rates 5-2 , 5-5 reset 5-2 , 5-3 , 5-9 timeout 5-2 coprst ?arm/reset cop timer circuitry reg. 5-3 corruption of a/d 6-6 of memory 2-3 cpha - bit in spcr 9-3 , 9-4 , 9-7 cpol - bit in spcr 9-7 cpu accumulators (a, b and d) 3-2 architecture 3-1 ccr ?condition code reg. 3-4 index registers (ix, iy) 3-2 program counter (pc) 3-4 programming model 3-1 registers 3-1 reset 5-7 cr[1:0] - bits in option 5-5 csel - bit in option 11-6 cwom - bit in opt2 6-11 d dac 11-3 data format, sci 7-2 data types 3-6 dda[7:0] - bits in ddra 6-2 ddb[7:0] - bits in ddrb 6-3 ddc[7:0] - bits in ddrc 6-4 ddd[5:0] - bits in ddrd 6-5 ddf[7:0] - bits in ddrf 6-7 ddg[7:0] - bits in ddrg 6-8 ddra ?data direction reg. for port a 6-2 ddrb ?data direction reg. for port b 6-3 ddrc ?data direction reg. for port c 6-4 ddrd ?data direction reg. for port d 6-5 ddrf ?data direction reg. for port f 6-7 ddrg ?data direction reg. for port g 6-8 development tools c-1 dir - direct addressing mode 3-7 dly - bit in option 4-17 mask option 4-17 dwom - bit in spcr 9-6 e e clock pin 2-5 edgxa and edgxb - bits in tctl2 10-7 eelat - bit in pprog 4-25 eeon - bit in config 4-13 eepgm - bit in pprog 4-25 eeprom 4-24 4-27 erased state ($ff) 4-24 erasing 4-26 4-27 pprog ?eeprom programming control reg. 4-24 security 4-28 eex - bits in init2 4-15 elat - bit in eprog 4-22 epgm - bit in eprog 4-23 eprog ?eprom programming control reg. 4-22 eprom 4-6 , 4-22 4-24 device 1-1 eprog ?eprom programming control reg. 4-22 erased state ($ff) 4-22 programming 4-23 erase - bit in pprog 4-25 erased state eeprom ($ff) 4-24 eprom ($ff) 4-22 error detection, sci 7-5 esd protection a-1 even - bit in pprog 4-24 event counter - see pulse accumulator evs ?evaluation system c-1 excol - bit in eprog 4-23 exrow - bit in eprog 4-23 ext4x - bit in opt2 4-19 extal pin 2-3 extali 2-6 f fcme - bit in option 5-5 fe - bit in scsr1 7-11 foc[1:5] - bits in cforc 10-11 fppue - bit in ppar 6-10 free-running counter 10-1 g gppue - bit in ppar 6-10 h h-bit in ccr 3-6 hppue - bit in ppar 6-10 hprio ?highest priority i-bit interrupt & misc. reg. 4-11 i i/o, on reset 5-8 i 2 c bus 8-1 arbitration 8-5 clock synchronization 8-5 tpg 222
mc68hc11pa8 motorola vii index configuration 8-2 data transfer 8-4 handshaking 8-6 madr ?i 2 c bus address register 8-7 mcr ?i 2 c bus control register 8-8 mdr ?i 2 c bus data register 8-10 mfdr ?i 2 c bus frequency divider register 8-7 msr ?i 2 c bus status register 8-9 programming considerations 8-11 protocol 8-2 repeated start signal 8-5 reset 5-9 scl 8-4 , 8-5 sda 8-4 slave address transmission 8-4 start signal 8-4 stop signal 8-4 i4/05 - bit in pactl 10-8 , 10-22 i4/o5f - bit in tflg1 10-14 i4/o5i - bit in tmsk1 10-13 i-bit in ccr 3-5 , 5-15 ic1f?c3f - bits in tflg1 10-14 ic1i?c3i - bits in tmsk1 10-13 idle - bit in scsr1 7-10 idle-line wakeup 7-4 ilie - bit in sccr2 7-9 illegal opcode trap 5-15 ilt - bit in sccr1 7-8 imm - immediate addressing mode 3-7 ind, x/y - indexed addressing modes 3-8 index registers (ix, iy) 3-2 inh - inherent addressing mode 3-8 init ?ram and i/o mapping reg. 4-14 initialization 4-12 input capture 10-6 instruction set 3-8 internal oscillator 4-16 , 11-4 , 11-5 , a-16 interrupts i-bit 3-5 , 5-15 illegal opcode trap 5-15 irq 2-12 maskable 5-16 multiple sources 2-12 non-maskable 5-15 priorities 5-10 priority resolution 5-20 sci 5-23 , 7-14 sensitivity 2-12 stacking 5-14 swi 5-15 triggering 2-12 types 5-14 vectors 5-13 wired-or 2-12 x-bit 3-6 , 5-15 xirq 2-12 , 5-15 irq pin 2-12 irqe - bit in option 4-16 irvne - bit in opt2 4-19 j junction temperature, chip a-1 l lcd driver interface 9-1 lir pin 2-13 lirdv - bit in opt2 4-18 loops - bit in sccr1 7-7 low power modes ram 4-5 stand-by connections 2-13 stand-by voltage 2-13 stop 5-17 wait 5-16 low voltage inhibit circuit 2-3 lsbf - bit in opt2 9-10 lvi 2-3 m m - bit in sccr1 7-8 maas - bit in msr 8-9 madr ?i 2 c bus address register 8-7 madr[7:1] - bits in madr 8-7 mal - bit in mal 8-9 mask options 1-2 oscillator buffer type 2-4 pll crystal frequency 2-7 security 4-28 stabilization delay timing 4-17 state of synr on reset 2-11 maximum ratings a-1 mbb - bit in msr 8-9 mbc[4:0] - bits in mfdr 8-7 mbe - bit in eprog 4-22 mbsp - bit in config 8-6 m-bus ?see i 2 c bus MC68HC711PA8 1-1 mcf - bit in msr 8-9 mcr ?i 2 c bus control register 8-8 mcs - bit in pllcr 2-10 mda - bit in hprio 4-11 mdr ?i 2 c bus data register 8-10 memory corruption of 2-3 eeprom 4-24 4-27 eprom 4-6 , 4-22 4-24 map 4-4 mapping 4-4 , 4-14 4-15 protection 4-20 , 4-28 ram 4-5 ram stand-by connections 2-13 register map 4-6 rom 4-6 stretch external access 4-18 tpg 223
motorola viii mc68hc11pa8 index memory map, on reset 5-7 men - bit in mcr 8-8 mfdr ?i 2 c bus frequency divider register 8-7 mien - bit in mcr 8-8 mif - bit in msr 8-10 miso 9-4 moda/lir pin 2-13 modb/vstby pin 2-13 modf - bit in spsr 9-8 mosi 9-4 msr ?i 2 c bus status register 8-9 msta - bit in mcr 8-8 mstr - bit in spcr 9-5 , 9-6 mtx - bit in mcr 8-8 mult - bit in adctl 11-9 multiplexer, a/d 11-3 , 11-7 multiplication factor, pll 2-11 n n-bit in ccr 3-5 nf - bit in scsr1 7-11 nmi 2-12 , 5-15 nocop - bit in config 5-6 noise 2-2 , 2-5 , 2-7 non-maskable interrupt 2-12 nosec - bit in config 4-29 o oc1d ?output compare 1 data reg. 10-11 oc1d[7:3] - bits in oc1d 10-11 oc1f?c4f - bits in tflg1 10-14 oc1i?c4i - bits in tmsk1 10-13 oc1m ?output compare 1 mask reg. 10-11 oc1m[7:3] - bits in oc1m 10-11 odd - bit in pprog 4-24 ol[2:5] - bits in tctl1 10-12 om[2:5] - bits in tctl1 10-12 operating modes 4-1 baud rates 4-2 bootstrap 4-2 expanded 4-1 hprio register 4-11 selection of 2-13 , 4-10 single chip 4-1 stop 4-5 , 5-17 test 4-2 vstby 4-5 wait 5-16 opt2 ?system configuration options reg. 2 4-18 option ?system configuration options reg. 1 5-4 , 11-5 or - bit in scsr1 7-11 ordering information b-4 oscillator 2-3 connections 2-4 output compare 10-9 overflow bit in ccr 3-5 p packages options 2-1 , b-1 thermal characteristics a-1 pacnt ?pulse accumulator count reg. 10-23 pactl ?pulse accumulator control reg. 10-22 paen - bit in pactl 10-22 paif - bit in tflg2 10-24 paii - bit in tmsk2 10-24 pamod - bit in pactl 10-22 paovf - bit in tflg2 10-23 paovi - bit in tmsk2 10-23 paren - bit in config 6-12 pe - bit in sccr1 7-8 pedge - bit in pactl 10-22 pf - bit in scsr1 7-11 phase-locked loop - see pll pins e clock 2-5 extal 2-3 irq 2-12 lir 2-13 moda/lir 2-13 modb/vstby 2-13 oc1, special features 10-4 , 10-9 r/w 2-13 reset 2-3 , 5-2 vdd, vss 2-2 vddsyn 2-6 vppe 2-12 vrh, vrl 2-13 vstby 2-13 xfc 2-6 xirq /vppe 2-12 xout 4-13 xtal 2-3 pll 2-6 bandwidth 2-7 block diagram 2-6 changing frequency 2-8 crystal frequency mask option 2-7 maximum frequency 2-7 multiplication factor 2-11 pllcr ?pll control reg. 2-9 synchronisation 2-8 synr ?synthesizer program reg. 2-11 vcoout 2-9 pllcr ?pll control reg. 2-9 pllon - bit in pllcr 2-9 por 5-1 stabilization delay 5-1 porta ?port a data register 6-2 portb ?port b data register 6-3 portc ?port c data register 6-4 portd ?port d data register 6-5 porte ?port e data register 6-6 tpg 224
mc68hc11pa8 motorola ix index portf ?port f data register 6-7 portg ?port g data register 6-8 ports a (timer) 2-14 , 6-2 b (a[15:8]) 2-14 b (addr[15:8]) 6-3 c (d[7:0]) 2-15 c (data[7:0]) 6-4 d (sci, spi/i 2 c bus) 2-16 , 6-5 ddra ?data direction reg. for port a 6-2 ddrb ?data direction reg. for port b 6-3 ddrc ?data direction reg. for port c 6-4 ddrd ?data direction reg. for port d 6-5 ddrf ?data direction reg. for port f 6-7 ddrg ?data direction reg. for port g 6-8 e (a/d, i 2 c bus) 2-16 , 6-6 f (a[7:0]) 2-17 f (addr[7:0]) 6-7 g (r/w ) 2-17 , 6-8 porta ?port a data register 6-2 portb ?port b data register 6-3 portc ?port c data register 6-4 portd ?port d data register 6-5 porte ?port e data register 6-6 portf ?port f data register 6-7 portg ?port g data register 6-8 signals 2-14 power-on reset - see por ppar ?port pull-up assignment reg. 6-10 pprog ?eeprom programming control reg. 4-24 pr[1:0] - bits in tmsk2 4-21 , 10-15 prebyte 3-7 priorities, resets and interrupts 5-10 , 5-11 program counter (pc) 3-4 programming config 4-27 eeprom 4-24 eprom 4-23 protection of memory 4-20 , 4-28 registers 4-10 psel[4:0] - bits in hprio 5-11 pt - bit in sccr1 7-8 ptcon - bit in bprot 4-20 pull-ups 6-10 pulse accumulator 10-1 , 10-20 block diagram 10-21 pacnt ?pulse accumulator count reg. 10-23 pactl ?pulse accumulator control reg. 10-22 reset 5-8 tflg2 ?timer interrupt flag 2 reg. 10-23 tmsk2 ?timer interrupt mask 2 reg. 10-23 r r/t[7:0] - bits in scdrl 7-12 r/w pin 2-13 r8 - bit in scdrh 7-12 raf - bit in scsr2 7-12 ram 4-5 data retention 4-5 security 4-28 ram[3:0] - bits in init 4-14 ratiometric conversions 11-4 rboot - bit in hprio 4-11 rdrf - bit in scsr1 7-10 re - bit in sccr2 7-9 real-time interrupt - see rti receiver flags, sci 7-13 reg[3:0] - bits in init 4-14 rel - relative addressing mode 3-8 reset pin 2-3 resets circuit 2-3 clock monitor 5-3 , 5-5 cop 5-2 , 5-3 effect on a/d 5-9 effect on cop 5-9 effect on cpu 5-7 effect on i/o 5-8 effect on i 2 c bus 5-9 effect on memory map 5-7 effect on pulse accumulator 5-8 effect on rti 5-8 effect on sci 5-9 effect on spi 5-9 effect on system 5-9 effect on timer 5-8 effects of 5-7 external 5-2 hprio ?highest priority i-bit interrupt and misc. reg. 5-11 power-on, por 5-1 priorities 5-10 processing flow 5-18 reset pin 5-2 vectors 5-7 , 5-13 resetting the cop watchdog 5-3 rfi 2-5 rie - bit in sccr2 7-9 rom 4-6 romad - bit in config 4-12 romon - bit in config 4-13 row - bit in pprog 4-25 rti 10-2 , 10-17 pactl ?pulse accumulator control reg. 10-19 rates 10-17 reset 5-8 tflg2 ?timer interrupt flag reg. 2 10-18 tmsk2 ?timer interrupt mask reg. 2 10-17 rtif - bit in tflg2 10-18 rtii - bit in tmsk2 10-18 rtr[1:0] - bits in pactl 10-19 rwu - bit in sccr2 7-4 , 7-9 rxak - bit in msr 8-10 tpg 225
motorola x mc68hc11pa8 index s s-bit in ccr 3-6 sbk - bit in sccr2 7-9 sbr[12:0] - bits in scbdh/l 7-6 scan - bit in adctl 11-8 scbdh, scbdl ?sci baud rate control reg. 7-6 sccr1 ?sci control reg. 1 7-7 sccr2 ?sci control reg. 2 7-9 scdrh, scdrl ?sci data high/low reg. 7-12 sci 7-1 baud rate 7-1 , 7-6 block diagram 7-3 data format 7-2 error detection 7-5 interrupt source resolution 5-23 , 7-14 pins 7-1 receive operation 7-2 reset 5-9 scbdh, scbdl ?sci baud rate control reg. 7-6 sccr1 ?sci control reg. 1 7-7 sccr2 ?sci control reg. 2 7-9 scdrh, scdrl ?sci data high/low reg. 7-12 scsr1 ?sci status reg. 1 7-10 scsr2 ?sci status reg. 2 7-12 status flags 7-13 transmit operation 7-2 wakeup 7-4 sck 9-4 scl 8-4 , 8-5 scsr1 ?sci status reg. 1 7-10 scsr2 ?sci status reg. 2 7-12 sda 8-4 security 4-28 mask option 4-28 nosec bit 4-29 sensitivity, of interrupts 2-12 , 4-16 , 4-20 , 6-12 serial communications interface - see sci serial peripheral interface - see spi slave select (ss ) 9-4 slow memory 4-18 smod - bit in hprio 4-11 software interrupt (swi) 5-15 spcr ?serial peripheral control reg. 9-6 spdr ?spi data reg. 9-9 spe - bit in spcr 9-6 spi 9-1 block diagram 9-2 buffering 9-1 , 9-9 clock phase 9-3 clock polarity 9-7 clock rate 9-4 , 9-7 errors 9-5 master mode 9-6 miso 9-4 mosi 9-4 opt2 ?system configuration options reg. 2 9-9 pins 9-1 polarity 9-3 reset 5-9 sck 9-4 signals 9-3 spcr ?serial peripheral control reg. 9-6 spdr ?spi data reg. 9-9 spsr ?serial peripheral status reg. 9-8 ss 9-4 transfer formats 9-2 , 9-3 spie - bit in spcr 9-5 , 9-6 spif - bit in spsr 9-8 spr1 and spr0 - bits in spcr 9-7 spr2 - bit in opt2 9-10 spsr ?serial peripheral status reg. 9-8 srw - bit in msr 8-10 stack pointer (sp) 3-2 stacking operations 3-3 stand-by voltage 2-13 status flags, sci 7-13 stop mode 4-5 , 5-17 disabling 3-6 stabilization delay 4-17 strch - bit in opt2 4-18 stretch, external access 4-18 swi 5-15 synchronisation, a/d 11-4 synr ?synthesizer program reg. 2-11 synx[1:0] - bits in synr 2-11 syny[5:0] - bits in synr 2-11 system reset 5-9 t t8 - bit in scdrh 7-12 tc - bit in scsr1 7-10 tcie - bit in sccr2 7-9 tcnt ?timer counter reg. 10-12 tctl1 ?timer control reg. 1 10-12 tctl2 ?timer control reg. 2 10-7 tdre - bit in scsr1 7-10 te - bit in sccr2 7-9 test methods a-3 tflg1 ?timer interrupt flag reg. 1 10-14 tflg2 ?timer interrupt flag reg. 2 10-16 ti4/o5 ?timer input capture 4/output compare 5 reg. 10-8 tic1?ic3 ?timer input capture reg. 10-8 tie - bit in sccr2 7-9 time accumulation - see pulse accumulator timer 10-1 block diagram 10-5 cforc ?timer compare force reg. 10-10 clock divider chains 10-3 coherency 10-10 cop 10-20 free-running counter 10-1 input capture 10-6 oc1, special features 10-4 , 10-9 oc1d ?output compare 1 data reg. 10-11 oc1m ?output compare 1 mask reg. 10-11 output compare 10-9 pins 10-4 tpg 226
mc68hc11pa8 motorola xi index prescaler 10-1 reset 5-8 tcnt ?timer counter reg. 10-12 tctl1 ?timer control reg. 1 10-12 tctl2 ?timer control reg. 2 10-7 tflg1 ?timer interrupt flag reg. 1 10-14 tflg2 ?timer interrupt flag reg. 2 10-16 ti4/o5 ?timer input capture 4/output compare 5 reg. 10-8 tic1?ic3 ?timer input capture reg. 10-8 tmsk1 ?timer interrupt mask reg. 1 10-13 tmsk2 ?timer interrupt mask reg. 2 4-21 , 10-15 toc1?oc4 ?timer output compare reg. 10-10 tmsk1 ?timer interrupt mask reg. 1 10-13 tmsk2 ?timer interrupt mask reg. 2 4-21 , 10-15 toc1?oc4 ?timer output compare reg. 10-10 tof - bit in tflg2 10-16 , 10-18 toi - bit in tmsk2 10-15 trxd[7:0] - bits in msr 8-10 txak - bit in mcr 8-8 u uart 7-1 v v-bit in ccr 3-5 vcoout 2-9 vcot - bit in pllcr 2-10 vdd pin 2-2 vddsyn pin 2-6 vectors interrupt 5-13 reset 5-7 , 5-13 vppe pin 2-12 vrh, vrl pins 2-13 vss pin 2-2 vstby pin 2-13 w wait mode 2-10 , 5-16 wake - bit in sccr1 7-8 wakeup, sci 7-4 watchdog - see cop wcol - bit in spsr 9-8 wen - bit in pllcr 2-10 wired-or 2-12 , 2-16 , 4-2 , 6-11 woms - bit in sccr1 7-7 x x-bit in ccr 3-6 , 5-15 xfc pin 2-6 xirq 5-15 xirq /vppe 2-12 xout pin 4-13 xppue - bits in ppar 6-10 xtal pin 2-3 z z-bit in ccr 3-5 tpg 227
motorola xii mc68hc11pa8 index this page left blank intentionally tpg 228
1 2 3 4 5 6 7 8 9 10 11 a b c introduction pin descriptions cpu core and instruction set operating modes and on-chip memory resets and interrupts parallel input/output serial communications interface i 2 c bus serial peripheral interface timing system analog-to-digital converter electrical specifications mechanical data and ordering information development support tpg 229
1 2 3 4 5 6 7 8 9 10 11 a b c introduction pin descriptions cpu core and instruction set operating modes and on-chip memory resets and interrupts parallel input/output serial communications interface i 2 c bus serial peripheral interface timing system analog-to-digital converter electrical specifications mechanical data and ordering information development support tpg 230
2 1 3 4 5 6 7 8 9 10 11 12 13 14 15
2 1 3 4 5 6 7 8 9 10 11 12 13 14 15 how to reach us: mfax : rmfax0@email.sps.mot.com ?touchtone (602) 244-6609 internet : http://design-net.com usa/europe : motorola literature distribution; p.o. box 5405; denver, colorado 80217. 303-675-2140 japan : nippon motorola ltd.; tatsumi-spd-jldc, toshikatsu otsuki, 6f seibu-butsuryu-center, 3-14-2 tatsumi koto-ku, tokyo 135, japan. 81-3-3521-8315 hong kong : motorola semiconductors h.k. ltd.; 8b tai ping industrial park, 51 ting kok road, tai po, n.t., hong kong. 852-26629298


▲Up To Search▲   

 
Price & Availability of MC68HC711PA8

All Rights Reserved © IC-ON-LINE 2003 - 2022  

[Add Bookmark] [Contact Us] [Link exchange] [Privacy policy]
Mirror Sites :  [www.datasheet.hk]   [www.maxim4u.com]  [www.ic-on-line.cn] [www.ic-on-line.com] [www.ic-on-line.net] [www.alldatasheet.com.cn] [www.gdcy.com]  [www.gdcy.net]


 . . . . .
  We use cookies to deliver the best possible web experience and assist with our advertising efforts. By continuing to use this site, you consent to the use of cookies. For more information on cookies, please take a look at our Privacy Policy. X